SlhDsa.ExportEncryptedPkcs8PrivateKeyPem Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters) |
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a byte-based password. |
| ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters) |
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a char-based password. |
| ExportEncryptedPkcs8PrivateKeyPem(String, PbeParameters) |
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a char-based password. |
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters)
- Source:
- SlhDsa.cs
- Source:
- SlhDsa.cs
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a byte-based password.
public:
System::String ^ ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
member this.ExportEncryptedPkcs8PrivateKeyPem : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> string
Public Function ExportEncryptedPkcs8PrivateKeyPem (passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters) As String
Parameters
- passwordBytes
- ReadOnlySpan<Byte>
The bytes to use as a password when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
Exceptions
pbeParameters is null.
This instance has been disposed.
pbeParameters specifies a KDF that requires a char-based password.
-or-
pbeParameters does not represent a valid password-based encryption algorithm.
-or-
This instance only represents a public key.
-or-
The private key is not exportable.
-or-
An error occurred while exporting the key.
Applies to
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters)
- Source:
- SlhDsa.cs
- Source:
- SlhDsa.cs
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a char-based password.
public:
System::String ^ ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.ExportEncryptedPkcs8PrivateKeyPem : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> string
Public Function ExportEncryptedPkcs8PrivateKeyPem (password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters) As String
Parameters
- password
- ReadOnlySpan<Char>
The password to use when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
Exceptions
pbeParameters is null.
This instance has been disposed.
pbeParameters does not represent a valid password-based encryption algorithm.
-or-
This instance only represents a public key.
-or-
The private key is not exportable.
-or-
An error occurred while exporting the key.
Applies to
ExportEncryptedPkcs8PrivateKeyPem(String, PbeParameters)
- Source:
- SlhDsa.cs
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a char-based password.
public:
System::String ^ ExportEncryptedPkcs8PrivateKeyPem(System::String ^ password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public string ExportEncryptedPkcs8PrivateKeyPem(string password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.ExportEncryptedPkcs8PrivateKeyPem : string * System.Security.Cryptography.PbeParameters -> string
Public Function ExportEncryptedPkcs8PrivateKeyPem (password As String, pbeParameters As PbeParameters) As String
Parameters
- password
- String
The password to use when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
Exceptions
password or pbeParameters is null.