IKeyVaultClient.EncryptWithHttpMessagesAsync(String, String, String, String, Byte[], Dictionary<String,List<String>>, CancellationToken) Method

Definition

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.KeyOperationResult>> EncryptWithHttpMessagesAsync (string vaultBaseUrl, string keyName, string keyVersion, string algorithm, byte[] value, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = null);
abstract member EncryptWithHttpMessagesAsync : string * string * string * string * byte[] * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.KeyOperationResult>>

Parameters

vaultBaseUrl
System.String

The vault name, for example https://myvault.vault.azure.net.

keyName
System.String

The name of the key.

keyVersion
System.String

The version of the key.

algorithm
System.String

algorithm identifier. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'

value
System.Byte[]
customHeaders
System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.List<System.String>>

The headers that will be added to request.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<KeyOperationResult>>

Remarks

The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using 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.

Applies to