Modifica

Condividi tramite


EncryptedXml.GetDecryptionKey(EncryptedData, String) Method

Definition

Retrieves the decryption key from the specified EncryptedData object.

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

Parameters

encryptedData
EncryptedData

The EncryptedData object that contains the decryption key to retrieve.

symmetricAlgorithmUri
String

The size of the decryption key to retrieve.

Returns

A SymmetricAlgorithm object associated with the decryption key.

Exceptions

The value of the encryptedData parameter is null.

The encryptedData parameter has an EncryptionMethod property that is null.

-or-

The encrypted key cannot be retrieved using the specified parameters.

Remarks

Given an EncryptedData object, this method looks for the decryption key that can be used to retrieve the plain text data. If a key name is specified, the method looks for the symmetric algorithm or asymmetric algorithm that is associated with the key name as defined in the key name mapping. Otherwise, if a retrieval method or an EncryptedKey object is specified, the method loads the EncryptedKey object and calls the GetDecryptionKey method.

Applies to