EncryptedXml.GetDecryptionIV Method (EncryptedData, String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Retrieves the decryption initialization vector (IV) from an EncryptedData object.

Namespace:   System.Security.Cryptography.Xml
Assembly:  System.Security (in System.Security.dll)

public virtual byte[] GetDecryptionIV(
	EncryptedData encryptedData,
	string symmetricAlgorithmUri


Type: System.Security.Cryptography.Xml.EncryptedData

The EncryptedData object that contains the initialization vector (IV) to retrieve.

Type: System.String

The Uniform Resource Identifier (URI) that describes the cryptographic algorithm associated with the encryptedData value.

Return Value

Type: System.Byte[]

A byte array that contains the decryption initialization vector (IV).

Exception Condition

The value of the encryptedData parameter is null.


The value of the encryptedData parameter has an EncryptionMethod property that is null.


The value of the symmetricAlgorithmUrisymAlgUri parameter is not a supported algorithm.

Given an EncryptedData object, this method retrieves the decryption initialization vector (IV). The default behavior retrieves the IV as the first bytes of the CipherValue byte array.

For a list of Uniform Resource Identifier (URI) values supported by the symmetricAlgorithmUri parameter, see the list of constant fields associated with the EncryptedXml class.

.NET Framework
Available since 2.0
Return to top