MLKem.ExportEncryptedPkcs8PrivateKey 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
| 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. |
| ExportEncryptedPkcs8PrivateKey(String, PbeParameters) |
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password. |
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.
public:
cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> byte[]
member this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> byte[]
Public Function ExportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters) As Byte()
Parameters
- passwordBytes
- ReadOnlySpan<Byte>
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 byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
- Attributes
Exceptions
pbeParameters is null.
This instance has been disposed.
This instance only represents a public key.
-or-
The private key is not exportable.
-or-
An error occurred while exporting the key.
-or-
pbeParameters does not represent a valid password-based encryption algorithm.
Applies to
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
public:
cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> byte[]
member this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> byte[]
Public Function ExportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters) As Byte()
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 byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
- Attributes
Exceptions
pbeParameters is null.
This instance has been disposed.
This instance only represents a public key.
-or-
The private key is not exportable.
-or-
An error occurred while exporting the key.
-or-
pbeParameters does not represent a valid password-based encryption algorithm.
Applies to
ExportEncryptedPkcs8PrivateKey(String, PbeParameters)
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
public:
cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(System::String ^ password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public byte[] ExportEncryptedPkcs8PrivateKey(string password, System.Security.Cryptography.PbeParameters pbeParameters);
public byte[] ExportEncryptedPkcs8PrivateKey(string password, System.Security.Cryptography.PbeParameters pbeParameters);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.ExportEncryptedPkcs8PrivateKey : string * System.Security.Cryptography.PbeParameters -> byte[]
member this.ExportEncryptedPkcs8PrivateKey : string * System.Security.Cryptography.PbeParameters -> byte[]
Public Function ExportEncryptedPkcs8PrivateKey (password As String, pbeParameters As PbeParameters) As Byte()
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 byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
- Attributes
Exceptions
pbeParameters or password is null.
This instance has been disposed.
This instance only represents a public key.
-or-
The private key is not exportable.
-or-
An error occurred while exporting the key.
-or-
pbeParameters does not represent a valid password-based encryption algorithm.