Package com.wechat.pay.java.core.cipher
Class AbstractAeadCipher
java.lang.Object
com.wechat.pay.java.core.cipher.AbstractAeadCipher
- All Implemented Interfaces:
AeadCipher
- Direct Known Subclasses:
AeadAesCipher
带有关联数据的认证加密器
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAeadCipher(String algorithm, String transformation, int tagLengthBit, byte[] key) -
Method Summary
-
Constructor Details
-
AbstractAeadCipher
-
-
Method Details
-
encrypt
加密并转换为字符串- Specified by:
encryptin interfaceAeadCipher- Parameters:
associatedData- AAD,额外的认证加密数据,可以为空nonce- IV,随机字符串初始化向量plaintext- 明文- Returns:
- Base64编码的密文
-
decrypt
解密并转换为字符串- Specified by:
decryptin interfaceAeadCipher- Parameters:
associatedData- AAD,额外的认证加密数据,可以为空nonce- IV,随机字符串初始化向量ciphertext- 密文- Returns:
- UTF-8编码的明文
-