Interface AeadCipher

All Known Implementing Classes:
AbstractAeadCipher, AeadAesCipher

public interface AeadCipher
认证加密器
  • Method Summary

    Modifier and Type
    Method
    Description
    decrypt(byte[] associatedData, byte[] nonce, byte[] ciphertext)
    解密并转换为字符串
    encrypt(byte[] associatedData, byte[] nonce, byte[] plaintext)
    加密并转换为字符串
  • Method Details

    • encrypt

      String encrypt(byte[] associatedData, byte[] nonce, byte[] plaintext)
      加密并转换为字符串
      Parameters:
      associatedData - AAD,额外的认证加密数据,可以为空
      nonce - IV,随机字符串初始化向量
      plaintext - 明文
      Returns:
      Base64编码的密文
    • decrypt

      String decrypt(byte[] associatedData, byte[] nonce, byte[] ciphertext)
      解密并转换为字符串
      Parameters:
      associatedData - AAD,额外的认证加密数据,可以为空
      nonce - IV,随机字符串初始化向量
      ciphertext - 密文
      Returns:
      UTF-8编码的明文