public abstract class AbstractAeadCipher extends java.lang.Object implements AeadCipher
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAeadCipher(java.lang.String algorithm,
java.lang.String transformation,
int tagLengthBit,
byte[] key) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
decrypt(byte[] associatedData,
byte[] nonce,
byte[] ciphertext)
解密并转换为字符串
|
java.lang.String |
encrypt(byte[] associatedData,
byte[] nonce,
byte[] plaintext)
加密并转换为字符串
|
protected AbstractAeadCipher(java.lang.String algorithm,
java.lang.String transformation,
int tagLengthBit,
byte[] key)
public java.lang.String encrypt(byte[] associatedData,
byte[] nonce,
byte[] plaintext)
encrypt in interface AeadCipherassociatedData - AAD,额外的认证加密数据,可以为空nonce - IV,随机字符串初始化向量plaintext - 明文public java.lang.String decrypt(byte[] associatedData,
byte[] nonce,
byte[] ciphertext)
decrypt in interface AeadCipherassociatedData - AAD,额外的认证加密数据,可以为空nonce - IV,随机字符串初始化向量ciphertext - 密文