MLDsa.ImportEncryptedPkcs8PrivateKey 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。
重载
| 名称 | 说明 |
|---|---|
| ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。 |
| ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>) |
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。 |
| ImportEncryptedPkcs8PrivateKey(String, Byte[]) |
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。 |
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。
public:
static System::Security::Cryptography::MLDsa ^ ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, ReadOnlySpan<System::Byte> source);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.MLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source);
public static System.Security.Cryptography.MLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> System.Security.Cryptography.MLDsa
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> System.Security.Cryptography.MLDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte)) As MLDsa
参数
- passwordBytes
- ReadOnlySpan<Byte>
解密密钥材料时用作密码的字节。
- source
- ReadOnlySpan<Byte>
ASN.1-BER 编码中的 PKCS#8 EncryptedPrivateKeyInfo 结构的字节。
返回
导入的密钥。
- 特性
例外
不表示 ASN.1-BER 编码的 PKCS#8 EncryptedPrivateKeyInfo 结构的内容 source 。
-或者-
指定的密码不正确。
-或者-
EncryptedPrivateKeyInfo 指示要应用的密钥派生函数(KDF)是需要 Char基于密码的旧 PKCS#12 KDF。
-或者-
该值不表示 ML-DSA 键。
-或者-
source 包含 ASN.1 结构后面的尾随数据。
-或者-
特定于算法的导入失败。
该平台不支持 ML-DSA。 调用方可以使用该 IsSupported 属性来确定平台是否支持 ML-DSA。
适用于
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。
public:
static System::Security::Cryptography::MLDsa ^ ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> source);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.MLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source);
public static System.Security.Cryptography.MLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * ReadOnlySpan<byte> -> System.Security.Cryptography.MLDsa
static member ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * ReadOnlySpan<byte> -> System.Security.Cryptography.MLDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), source As ReadOnlySpan(Of Byte)) As MLDsa
参数
- password
- ReadOnlySpan<Char>
解密密钥材料时要使用的密码。
- source
- ReadOnlySpan<Byte>
ASN.1-BER 编码中的 PKCS#8 EncryptedPrivateKeyInfo 结构的字节。
返回
导入的密钥。
- 特性
例外
不表示 ASN.1-BER 编码的 PKCS#8 EncryptedPrivateKeyInfo 结构的内容 source 。
-或者-
指定的密码不正确。
-或者-
该值不表示 ML-DSA 键。
-或者-
source 包含 ASN.1 结构后面的尾随数据。
-或者-
特定于算法的导入失败。
该平台不支持 ML-DSA。 调用方可以使用该 IsSupported 属性来确定平台是否支持 ML-DSA。
适用于
ImportEncryptedPkcs8PrivateKey(String, Byte[])
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
从 PKCS#8 EncryptedPrivateKeyInfo 结构导入 ML-DSA 私钥。
public:
static System::Security::Cryptography::MLDsa ^ ImportEncryptedPkcs8PrivateKey(System::String ^ password, cli::array <System::Byte> ^ source);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.MLDsa ImportEncryptedPkcs8PrivateKey(string password, byte[] source);
public static System.Security.Cryptography.MLDsa ImportEncryptedPkcs8PrivateKey(string password, byte[] source);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ImportEncryptedPkcs8PrivateKey : string * byte[] -> System.Security.Cryptography.MLDsa
static member ImportEncryptedPkcs8PrivateKey : string * byte[] -> System.Security.Cryptography.MLDsa
Public Shared Function ImportEncryptedPkcs8PrivateKey (password As String, source As Byte()) As MLDsa
参数
- password
- String
解密密钥材料时要使用的密码。
- source
- Byte[]
ASN.1-BER 编码中的 PKCS#8 EncryptedPrivateKeyInfo 结构的字节。
返回
导入的密钥。
- 特性
例外
password 或 source 为 null.