다음을 통해 공유


CryptographyClient.UnwrapKeyAsync Method

Definition

Decrypts the specified encrypted key.

public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.UnwrapResult> UnwrapKeyAsync (Azure.Security.KeyVault.Keys.Cryptography.KeyWrapAlgorithm algorithm, byte[] encryptedKey, System.Threading.CancellationToken cancellationToken = default);
abstract member UnwrapKeyAsync : Azure.Security.KeyVault.Keys.Cryptography.KeyWrapAlgorithm * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.UnwrapResult>
override this.UnwrapKeyAsync : Azure.Security.KeyVault.Keys.Cryptography.KeyWrapAlgorithm * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.UnwrapResult>
Public Overridable Function UnwrapKeyAsync (algorithm As KeyWrapAlgorithm, encryptedKey As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of UnwrapResult)

Parameters

algorithm
KeyWrapAlgorithm

The KeyWrapAlgorithm to use.

encryptedKey
Byte[]

The encrypted key.

cancellationToken
CancellationToken

A CancellationToken to cancel the operation.

Returns

The result of the unwrap operation. The returned UnwrapResult contains the key along with information regarding the algorithm and key used to unwrap 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