Share via


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 物件。

例外狀況

encryptedData 參數的值為 null

encryptedData 參數有 null 的 EncryptionMethod 屬性。

-或-

無法使用指定的參數,擷取加密金鑰。

備註

EncryptedData給定物件時,這個方法會尋找可用來擷取純文字資料的解密金鑰。 如果指定金鑰名稱,此方法會尋找與金鑰名稱對應中所定義之金鑰名稱相關聯的對稱演算法或非對稱演算法。 否則,如果指定擷取方法或 EncryptedKey 物件,方法會 EncryptedKey 載入 物件並呼叫 GetDecryptionKey 方法。

適用於