CryptographyClient.SecureWrapKeyAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Wraps the specified key using secure wrap.
public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.SecureWrapResult> SecureWrapKeyAsync(Azure.Security.KeyVault.Keys.Cryptography.SecureKeyWrapAlgorithm algorithm, System.Threading.CancellationToken cancellationToken = default);
abstract member SecureWrapKeyAsync : Azure.Security.KeyVault.Keys.Cryptography.SecureKeyWrapAlgorithm * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.SecureWrapResult>
override this.SecureWrapKeyAsync : Azure.Security.KeyVault.Keys.Cryptography.SecureKeyWrapAlgorithm * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.Cryptography.SecureWrapResult>
Public Overridable Function SecureWrapKeyAsync (algorithm As SecureKeyWrapAlgorithm, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SecureWrapResult)
Parameters
- algorithm
- SecureKeyWrapAlgorithm
The SecureKeyWrapAlgorithm to use.
- cancellationToken
- CancellationToken
A CancellationToken to cancel the operation.
Returns
The result of the secure wrap operation. The returned SecureWrapResult contains the wrapped key along with all other information needed to unwrap it. This information should be stored with the wrapped key.
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.