Share via


CryptographyClient.Decrypt Method

Definition

Overloads

Decrypt(DecryptParameters, CancellationToken)

Decrypts the specified ciphertext.

Decrypt(EncryptionAlgorithm, Byte[], CancellationToken)

Decrypts ciphertext.

Decrypt(DecryptParameters, CancellationToken)

Source:
CryptographyClient.cs
Source:
CryptographyClient.cs

Decrypts the specified ciphertext.

public virtual Azure.Security.KeyVault.Keys.Cryptography.DecryptResult Decrypt (Azure.Security.KeyVault.Keys.Cryptography.DecryptParameters decryptParameters, System.Threading.CancellationToken cancellationToken = default);
abstract member Decrypt : Azure.Security.KeyVault.Keys.Cryptography.DecryptParameters * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.DecryptResult
override this.Decrypt : Azure.Security.KeyVault.Keys.Cryptography.DecryptParameters * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.DecryptResult
Public Overridable Function Decrypt (decryptParameters As DecryptParameters, Optional cancellationToken As CancellationToken = Nothing) As DecryptResult

Parameters

decryptParameters
DecryptParameters

A DecryptParameters containing the data to decrypt and other parameters for algorithm-dependent decryption.

cancellationToken
CancellationToken

A CancellationToken to cancel the operation.

Returns

The result of the decrypt operation. The returned DecryptResult contains the encrypted data along with information regarding the algorithm and key used to decrypt it.

Exceptions

The specified algorithm does not match the key corresponding to the key identifier.

decryptParameters is null.

The local cryptographic provider threw an exception.

The key is invalid for the current operation.

The operation is not supported with the specified key.

The server returned an error. See Message for details returned from the server.

Applies to

Decrypt(EncryptionAlgorithm, Byte[], CancellationToken)

Source:
CryptographyClient.cs
Source:
CryptographyClient.cs

Decrypts ciphertext.

public virtual Azure.Security.KeyVault.Keys.Cryptography.DecryptResult Decrypt (Azure.Security.KeyVault.Keys.Cryptography.EncryptionAlgorithm algorithm, byte[] ciphertext, System.Threading.CancellationToken cancellationToken = default);
abstract member Decrypt : Azure.Security.KeyVault.Keys.Cryptography.EncryptionAlgorithm * byte[] * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.DecryptResult
override this.Decrypt : Azure.Security.KeyVault.Keys.Cryptography.EncryptionAlgorithm * byte[] * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.DecryptResult
Public Overridable Function Decrypt (algorithm As EncryptionAlgorithm, ciphertext As Byte(), Optional cancellationToken As CancellationToken = Nothing) As DecryptResult

Parameters

ciphertext
Byte[]

The encrypted data to decrypt.

cancellationToken
CancellationToken

A CancellationToken to cancel the operation.

Returns

The result of the decrypt operation. The returned DecryptResult contains the encrypted data along with information regarding the algorithm and key used to decrypt it.

Exceptions

The specified algorithm does not match the key corresponding to the key identifier.

The local cryptographic provider threw an exception.

The key is invalid for the current operation.

The operation is not supported with the specified key.

The server returned an error. See Message for details returned from the server.

Applies to