KeyVaultKey.encryptAsync(byte[] plaintext, byte[] iv, byte[] authenticationData, String algorithm) 方法

定义

Encrypts the specified plain text. Note that not all algorithms require, or support, all parameters.

public ListenableFuture<Triple<byte[], byte[], String>> encryptAsync(byte[] plaintext, byte[] iv, byte[] authenticationData, String algorithm)

参数

plaintext
byte []

The plain text to encrypt

iv
byte []

The initialization vector (optional with some algorithms)

authenticationData
byte []

Additional authentication data (optional with some algorithms)

algorithm
String

The encryption algorithm to use, defaults to the keys DefaultEncryptionAlgorithm

返回

ListenableFuture<Triple<byte[], byte[], String>>

A ListenableFuture containing the cipher text, the authentication tag and the algorithm that was used

例外

NoSuchAlgorithmException

the algorithm is not valid

替代

适用于