KeyVaultClientExtensions.WrapKeyAsync 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.
Overloads
WrapKeyAsync(IKeyVaultClient, String, String, Byte[], CancellationToken) |
Wraps a symmetric key using the specified key |
WrapKeyAsync(IKeyVaultClient, String, String, String, String, Byte[], CancellationToken) |
Wraps a symmetric key using a specified key. |
WrapKeyAsync(IKeyVaultClient, String, String, Byte[], CancellationToken)
- Source:
- KeyVaultClientExtensions.cs
Wraps a symmetric key using the specified key
public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyOperationResult> WrapKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string keyIdentifier, string algorithm, byte[] key, System.Threading.CancellationToken cancellationToken = default);
static member WrapKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyOperationResult>
<Extension()>
Public Function WrapKeyAsync (operations As IKeyVaultClient, keyIdentifier As String, algorithm As String, key As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of KeyOperationResult)
Parameters
- operations
- IKeyVaultClient
- keyIdentifier
- String
The global key identifier of the key used for wrapping
- algorithm
- String
The wrap algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
- key
- Byte[]
The symmetric key
- cancellationToken
- CancellationToken
Optional cancellation token
Returns
The wrapped symmetric key
Applies to
WrapKeyAsync(IKeyVaultClient, String, String, String, String, Byte[], CancellationToken)
- Source:
- KeyVaultClientExtensions.cs
Wraps a symmetric key using a specified key.
public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyOperationResult> WrapKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, string keyVersion, string algorithm, byte[] value, System.Threading.CancellationToken cancellationToken = default);
static member WrapKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * string * string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyOperationResult>
<Extension()>
Public Function WrapKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, keyVersion As String, algorithm As String, value As Byte(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of KeyOperationResult)
Parameters
- operations
- IKeyVaultClient
The operations group for this extension method.
- vaultBaseUrl
- String
The vault name, for example https://myvault.vault.azure.net.
- keyName
- String
The name of the key.
- keyVersion
- String
The version of the key.
- algorithm
- String
algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
- value
- Byte[]
- cancellationToken
- CancellationToken
The cancellation token.
Returns
Remarks
The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.
Applies to
Azure SDK for .NET