Class AESCryptoProvider

java.lang.Object
com.nimbusds.jose.crypto.impl.BaseJWEProvider
com.nimbusds.jose.crypto.impl.AESCryptoProvider
All Implemented Interfaces:
JCAAware<JWEJCAContext>, JOSEProvider, JWEProvider
Direct Known Subclasses:
AESDecrypter, AESEncrypter

public abstract class AESCryptoProvider extends BaseJWEProvider
Version:
2015-06-29
Author:
Melisa Halsband, Vladimir Dzhuvinov
  • Field Details

  • Constructor Details

    • AESCryptoProvider

      Creates a new AES encryption / decryption provider.
      Parameters:
      kek - The Key Encryption Key. Must be 128 bits (16 bytes), 192 bits (24 bytes) or 256 bits (32 bytes). Must not be null.
      cek - The content encryption key (CEK) to use. If specified its algorithm must be "AES" or "ChaCha20" and its length must match the expected for the JWE encryption method ("enc"). If null a CEK will be generated for each JWE.
      Throws:
      KeyLengthException - If the KEK length is invalid.
  • Method Details

    • getKey

      public SecretKey getKey()
      Gets the Key Encryption Key (KEK).
      Returns:
      The Key Encryption Key.