KeyVaultClient.EncryptAsync Method (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 keyIdentifier,
string algorithm,
byte[] plainText,
CancellationToken cancellationToken = null
)
public:
Task<KeyOperationResult^>^ EncryptAsync(
String^ keyIdentifier,
String^ algorithm,
array<unsigned char>^ plainText,
CancellationToken cancellationToken = null
)
member EncryptAsync :
keyIdentifier:string *
algorithm:string *
plainText:byte[] *
cancellationToken:CancellationToken = null -> Task<KeyOperationResult>
Public Function EncryptAsync (
keyIdentifier As String,
algorithm As String,
plainText As Byte(),
cancellationToken As CancellationToken
) As Task(Of KeyOperationResult)
Parameters
keyIdentifier
Type: System.StringThe full key identifier.
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