Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) |
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password. |
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) |
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password. |
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.
public:
virtual cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public virtual byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
abstract member ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> byte[]
override this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> byte[]
Public Overridable Function ExportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters) As Byte()
The bytes to use as a password when encrypting the key material.
The password-based encryption (PBE) parameters to use when encrypting the key material.
A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
The key could not be exported.
-or-
pbeParameters
indicates that TripleDes3KeyPkcs12 should be used, which requires Char-based passwords.
The password bytes are passed directly into the Key Derivation Function (KDF) used by the algorithm indicated by pbeParameters
.
This enables compatibility with other systems which use a text encoding other than UTF-8 when processing passwords with PBKDF2 (Password-Based Key Derivation Function 2).
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
public:
virtual cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public virtual byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
abstract member ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> byte[]
override this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> byte[]
Public Overridable Function ExportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters) As Byte()
The password to use when encrypting the key material.
The password-based encryption (PBE) parameters to use when encrypting the key material.
A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
The key could not be exported.
When pbeParameters
indicates an algorithm that uses PBKDF2 (Password-Based Key Derivation Function 2), the password is converted to bytes via the UTF-8 encoding.
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in