SlhDsa.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(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Imports an SLH-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure. |
| ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>) |
Imports an SLH-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure. |
| ImportEncryptedPkcs8PrivateKey(String, Byte[]) |
Imports an SLH-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure. |
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- SlhDsa.cs
- Source:
- SlhDsa.cs
Imports an SLH-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public:
static System::Security::Cryptography::SlhDsa ^ ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, ReadOnlySpan<System::Byte> source);
public static System.Security.Cryptography.SlhDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source);
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> System.Security.Cryptography.SlhDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte)) As SlhDsa
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 an SLH-DSA key.
-or-
source contains trailing data after the ASN.1 structure.
-or-
The algorithm-specific import failed.
The platform does not support SLH-DSA. Callers can use the IsSupported property to determine if the platform supports SLH-DSA.
Applies to
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)
- Source:
- SlhDsa.cs
- Source:
- SlhDsa.cs
Imports an SLH-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public:
static System::Security::Cryptography::SlhDsa ^ ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> source);
public static System.Security.Cryptography.SlhDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source);
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * ReadOnlySpan<byte> -> System.Security.Cryptography.SlhDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), source As ReadOnlySpan(Of Byte)) As SlhDsa
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 an SLH-DSA key.
-or-
source contains trailing data after the ASN.1 structure.
-or-
The algorithm-specific import failed.
The platform does not support SLH-DSA. Callers can use the IsSupported property to determine if the platform supports SLH-DSA.
Applies to
ImportEncryptedPkcs8PrivateKey(String, Byte[])
- Source:
- SlhDsa.cs
Imports an SLH-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public:
static System::Security::Cryptography::SlhDsa ^ ImportEncryptedPkcs8PrivateKey(System::String ^ password, cli::array <System::Byte> ^ source);
public static System.Security.Cryptography.SlhDsa ImportEncryptedPkcs8PrivateKey(string password, byte[] source);
static member ImportEncryptedPkcs8PrivateKey : string * byte[] -> System.Security.Cryptography.SlhDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (password As String, source As Byte()) As SlhDsa
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.