Share via


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

  • keyVersion
    Type: System.String

    The version of the key (optional).

Return Value

Type: System.Threading.Tasks.Task<KeyOperationResult>

The encrypted text.

See Also

EncryptAsync Overload
KeyVaultClient Class
Microsoft.Azure.KeyVault Namespace

Return to top