Condividi tramite


CryptographyClient.DecryptAsync Method

Definition

Overloads

DecryptAsync(EncryptionAlgorithm, Byte[], CancellationToken)

Decrypts the specified ciphertext.

DecryptAsync(DecryptParameters, CancellationToken)

Decrypts ciphertext.

DecryptAsync(EncryptionAlgorithm, Byte[], CancellationToken)

Source:
CryptographyClient.cs
Source:
CryptographyClient.cs

Decrypts the specified ciphertext.

public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.DecryptResult> DecryptAsync (Azure.Security.KeyVault.Keys.Cryptography.EncryptionAlgorithm algorithm, byte[] ciphertext, System.Threading.CancellationToken cancellationToken = default);
abstract member DecryptAsync : Azure.Security.KeyVault.Keys.Cryptography.EncryptionAlgorithm * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.DecryptResult>
override this.DecryptAsync : Azure.Security.KeyVault.Keys.Cryptography.EncryptionAlgorithm * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.DecryptResult>
Public Overridable Function DecryptAsync (algorithm As EncryptionAlgorithm, ciphertext As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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

DecryptAsync(DecryptParameters, CancellationToken)

Source:
CryptographyClient.cs
Source:
CryptographyClient.cs

Decrypts ciphertext.

public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.DecryptResult> DecryptAsync (Azure.Security.KeyVault.Keys.Cryptography.DecryptParameters decryptParameters, System.Threading.CancellationToken cancellationToken = default);
abstract member DecryptAsync : Azure.Security.KeyVault.Keys.Cryptography.DecryptParameters * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.DecryptResult>
override this.DecryptAsync : Azure.Security.KeyVault.Keys.Cryptography.DecryptParameters * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.DecryptResult>
Public Overridable Function DecryptAsync (decryptParameters As DecryptParameters, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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