KeyVaultClient.EncryptAsync Method (String, String, String, String, Byte[], CancellationToken)
Asynchronously encrypts a single block of data. The amount of data that may be encrypted is determined by the target key type and the encryption algorithm.
Namespace: Microsoft.Azure.KeyVault
Assembly: Microsoft.Azure.KeyVault (in Microsoft.Azure.KeyVault.dll)
Syntax
public Task<KeyOperationResult> EncryptAsync(
string vault,
string keyName,
string keyVersion,
string algorithm,
byte[] plainText,
CancellationToken cancellationToken = null
)
public:
Task<KeyOperationResult^>^ EncryptAsync(
String^ vault,
String^ keyName,
String^ keyVersion,
String^ algorithm,
array<unsigned char>^ plainText,
CancellationToken cancellationToken = null
)
member EncryptAsync :
vault:string *
keyName:string *
keyVersion:string *
algorithm:string *
plainText:byte[] *
cancellationToken:CancellationToken = null -> Task<KeyOperationResult>
Public Function EncryptAsync (
vault As String,
keyName As String,
keyVersion As String,
algorithm As String,
plainText As Byte(),
cancellationToken As CancellationToken
) As Task(Of KeyOperationResult)
Parameters
vault
Type: System.StringThe URL of the vault.
keyName
Type: System.StringThe name of the key.
keyVersion
Type: System.StringThe version of the key (optional).
algorithm
Type: System.StringThe algorithm. For more information on possible algorithm types, see JsonWebKeyEncryptionAlgorithm.
plainText
Type: System.Byte[]The plain text.
cancellationToken
Type: System.Threading.CancellationTokenOptional cancellation token.
Return Value
Type: System.Threading.Tasks.Task<KeyOperationResult>
The encrypted text.
See Also
EncryptAsync Overload
KeyVaultClient Class
Microsoft.Azure.KeyVault Namespace
Return to top