CompositeMLDsa.ImportEncryptedPkcs8PrivateKey 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
| ImportEncryptedPkcs8PrivateKey(String, Byte[]) |
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure. |
| ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>) |
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure. |
| ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure. |
ImportEncryptedPkcs8PrivateKey(String, Byte[])
- Source:
- CompositeMLDsa.cs
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public:
static System::Security::Cryptography::CompositeMLDsa ^ ImportEncryptedPkcs8PrivateKey(System::String ^ password, cli::array <System::Byte> ^ source);
public static System.Security.Cryptography.CompositeMLDsa ImportEncryptedPkcs8PrivateKey(string password, byte[] source);
static member ImportEncryptedPkcs8PrivateKey : string * byte[] -> System.Security.Cryptography.CompositeMLDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (password As String, source As Byte()) As CompositeMLDsa
Parameters
- password
- String
The password to use when decrypting the key material.
- source
- Byte[]
The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.
Returns
The imported key.
Exceptions
password or source is null.
Applies to
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)
- Source:
- CompositeMLDsa.cs
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public:
static System::Security::Cryptography::CompositeMLDsa ^ ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> source);
public static System.Security.Cryptography.CompositeMLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source);
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * ReadOnlySpan<byte> -> System.Security.Cryptography.CompositeMLDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), source As ReadOnlySpan(Of Byte)) As CompositeMLDsa
Parameters
- password
- ReadOnlySpan<Char>
The password to use when decrypting the key material.
- source
- ReadOnlySpan<Byte>
The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.
Returns
The imported key.
Exceptions
The contents of source do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
-or-
The specified password is incorrect.
-or-
The value does not represent a Composite ML-DSA key.
-or-
source contains trailing data after the ASN.1 structure.
-or-
The algorithm-specific import failed.
-or-
The specified Composite ML-DSA algorithm is not supported.
The platform does not support Composite ML-DSA. Callers can use the IsSupported property to determine if the platform supports Composite ML-DSA.
Applies to
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- CompositeMLDsa.cs
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public:
static System::Security::Cryptography::CompositeMLDsa ^ ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, ReadOnlySpan<System::Byte> source);
public static System.Security.Cryptography.CompositeMLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source);
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> System.Security.Cryptography.CompositeMLDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte)) As CompositeMLDsa
Parameters
- passwordBytes
- ReadOnlySpan<Byte>
The bytes to use as a password when decrypting the key material.
- source
- ReadOnlySpan<Byte>
The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.
Returns
The imported key.
Exceptions
The contents of source do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
-or-
The specified password is incorrect.
-or-
The EncryptedPrivateKeyInfo indicates the Key Derivation Function (KDF) to apply is the legacy PKCS#12 KDF, which requires Char-based passwords.
-or-
The value does not represent a Composite ML-DSA key.
-or-
source contains trailing data after the ASN.1 structure.
-or-
The algorithm-specific import failed.
-or-
The specified Composite ML-DSA algorithm is not supported.
The platform does not support Composite ML-DSA. Callers can use the IsSupported property to determine if the platform supports Composite ML-DSA.