Share via


IAuthenticatedEncryptor.Decrypt Method

Definition

Validates the authentication tag of and decrypts a blob of encrypted data.

public:
 cli::array <System::Byte> ^ Decrypt(ArraySegment<System::Byte> ciphertext, ArraySegment<System::Byte> additionalAuthenticatedData);
public byte[] Decrypt (ArraySegment<byte> ciphertext, ArraySegment<byte> additionalAuthenticatedData);
abstract member Decrypt : ArraySegment<byte> * ArraySegment<byte> -> byte[]
Public Function Decrypt (ciphertext As ArraySegment(Of Byte), additionalAuthenticatedData As ArraySegment(Of Byte)) As Byte()

Parameters

ciphertext
ArraySegment<Byte>

The ciphertext (including authentication tag) to decrypt.

additionalAuthenticatedData
ArraySegment<Byte>

Any ancillary data which was used during computation of the authentication tag. The same AAD must have been specified in the corresponding call to 'Encrypt'.

Returns

Byte[]

The original plaintext data (if the authentication tag was validated and decryption succeeded).

Remarks

All cryptography-related exceptions should be homogenized to CryptographicException.

Applies to