DSA.ImportFromEncryptedPem 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>) |
导入加密的 RFC 7468 PEM 编码私钥,替换此对象的密钥。 |
| ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>) |
导入加密的 RFC 7468 PEM 编码私钥,替换此对象的密钥。 |
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)
- Source:
- DSA.cs
- Source:
- DSA.cs
- Source:
- DSA.cs
- Source:
- DSA.cs
- Source:
- DSA.cs
导入加密的 RFC 7468 PEM 编码私钥,替换此对象的密钥。
public:
override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<System::Byte> passwordBytes);
public override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<byte> passwordBytes);
override this.ImportFromEncryptedPem : ReadOnlySpan<char> * ReadOnlySpan<byte> -> unit
Public Overrides Sub ImportFromEncryptedPem (input As ReadOnlySpan(Of Char), passwordBytes As ReadOnlySpan(Of Byte))
参数
- input
- ReadOnlySpan<Char>
要导入的加密密钥的 PEM 文本。
- passwordBytes
- ReadOnlySpan<Byte>
解密密钥材料时用作密码的字节。
例外
密码不正确。
-or-
The base-64 decoded contents of the PEM text from <code data-dev-comment-type="paramref">input</code> do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
-or-
The base-64 decoded contents of the PEM text from <code data-dev-comment-type="paramref">input</code> indicate the key is for an algorithm other than the algorithm represented by this instance.
-or-
The base-64 decoded contents of the PEM text from <code data-dev-comment-type="paramref">input</code> represent the key in a format that is not supported.
-or-
The algorithm-specific key import failed.
注解
密码字节将直接传递到算法所指示 pbeParameters的密钥派生函数 (KDF) 中。 这允许与其他使用 UTF-8 以外的文本编码的系统兼容,这些系统使用 PBKDF2 处理密码(Password-Based 密钥派生函数 2)。
将忽略不受支持的或格式不正确的 PEM 编码对象。 如果找到多个受支持的 PEM 标签,则会引发异常,以防止在键不明确时导入密钥。
此方法支持 ENCRYPTED PRIVATE KEY PEM 标签。
适用于
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)
- Source:
- DSA.cs
- Source:
- DSA.cs
- Source:
- DSA.cs
- Source:
- DSA.cs
- Source:
- DSA.cs
导入加密的 RFC 7468 PEM 编码私钥,替换此对象的密钥。
public:
override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<char> password);
public override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<char> password);
override this.ImportFromEncryptedPem : ReadOnlySpan<char> * ReadOnlySpan<char> -> unit
Public Overrides Sub ImportFromEncryptedPem (input As ReadOnlySpan(Of Char), password As ReadOnlySpan(Of Char))
参数
- input
- ReadOnlySpan<Char>
要导入的加密密钥的 PEM 文本。
- password
- ReadOnlySpan<Char>
用于解密密钥材料的密码。
例外
密码不正确。
-or-
The base-64 decoded contents of the PEM text from <code data-dev-comment-type="paramref">input</code> do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.
-or-
The base-64 decoded contents of the PEM text from <code data-dev-comment-type="paramref">input</code> indicate the key is for an algorithm other than the algorithm represented by this instance.
-or-
The base-64 decoded contents of the PEM text from <code data-dev-comment-type="paramref">input</code> represent the key in a format that is not supported.
-or-
The algorithm-specific key import failed.
注解
当 base-64 解码的内容 input 指示使用 PBKDF1(Password-Based 密钥派生函数 1)或 PBKDF2(Password-Based 密钥派生函数 2)的算法时,密码将通过 UTF-8 编码转换为字节。
将忽略不受支持的或格式不正确的 PEM 编码对象。 如果找到多个受支持的 PEM 标签,则会引发异常,以防止在键不明确时导入密钥。
此方法支持 ENCRYPTED PRIVATE KEY PEM 标签。