Class DirectCryptoProvider

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

public abstract class DirectCryptoProvider extends BaseJWEProvider
The base abstract class for direct encrypters and decrypters of JWE objects with a shared symmetric key.

Supports the following key management algorithms:

Supports the following content encryption algorithms:

Version:
2023-07-11
Author:
Vladimir Dzhuvinov
  • Field Details

  • Constructor Details

    • DirectCryptoProvider

      Creates a new direct encryption / decryption provider.
      Parameters:
      cek - The Content Encryption Key (CEK). Must be 128 bits (16 bytes), 192 bits (24 bytes), 256 bits (32 bytes), 384 bits (48 bytes) or 512 bits (64 bytes) long. Must not be null.
      Throws:
      KeyLengthException - If the CEK length is not compatible.
  • Method Details

    • getKey

      public SecretKey getKey()
      Gets the Content Encryption Key (CEK).
      Returns:
      The key.