EncryptedXml.GetDecryptionKey(EncryptedData, String) 方法

定义

从指定 EncryptedData 对象检索解密密钥。

public:
 virtual System::Security::Cryptography::SymmetricAlgorithm ^ GetDecryptionKey(System::Security::Cryptography::Xml::EncryptedData ^ encryptedData, System::String ^ symmetricAlgorithmUri);
public virtual System.Security.Cryptography.SymmetricAlgorithm? GetDecryptionKey(System.Security.Cryptography.Xml.EncryptedData encryptedData, string? symmetricAlgorithmUri);
public virtual System.Security.Cryptography.SymmetricAlgorithm GetDecryptionKey(System.Security.Cryptography.Xml.EncryptedData encryptedData, string symmetricAlgorithmUri);
abstract member GetDecryptionKey : System.Security.Cryptography.Xml.EncryptedData * string -> System.Security.Cryptography.SymmetricAlgorithm
override this.GetDecryptionKey : System.Security.Cryptography.Xml.EncryptedData * string -> System.Security.Cryptography.SymmetricAlgorithm
Public Overridable Function GetDecryptionKey (encryptedData As EncryptedData, symmetricAlgorithmUri As String) As SymmetricAlgorithm

参数

encryptedData
EncryptedData

EncryptedData包含要检索的解密密钥的对象。

symmetricAlgorithmUri
String

要检索的解密密钥的大小。

返回

SymmetricAlgorithm与解密密钥关联的对象。

例外

参数的值 encryptedDatanull.

encryptedData 参数的属性 EncryptionMethod 为 null。

-或-

无法使用指定的参数检索加密密钥。

注解

给定对象 EncryptedData 后,此方法将查找可用于检索纯文本数据的解密密钥。 如果指定了密钥名称,该方法将查找与密钥名称映射中定义的密钥名称关联的对称算法或非对称算法。 否则,如果指定了检索方法或 EncryptedKey 对象,该方法将加载对象 EncryptedKey 并调用 GetDecryptionKey 该方法。

适用于