Class AESCryptoProvider

    • Constructor Detail

      • AESCryptoProvider

        protected AESCryptoProvider​(SecretKey kek,
                                    SecretKey cek)
                             throws KeyLengthException
        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 Detail

      • getKey

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