Class RSA15AES256CBCHS512EncryptionHandler

java.lang.Object
org.forgerock.json.jose.jwe.handlers.encryption.AbstractEncryptionHandler
org.forgerock.json.jose.jwe.handlers.encryption.RSA15AES256CBCHS512EncryptionHandler
All Implemented Interfaces:
EncryptionHandler

@Deprecated public class RSA15AES256CBCHS512EncryptionHandler extends AbstractEncryptionHandler
Deprecated.
Use RSAEncryptionHandler and AESCBCHMACSHA2ContentEncryptionHandler instead.
An implementation of an EncryptionHandler that provides encryption and decryption methods using the JweAlgorithm RSAES_PCKS1_V1_5 and EncryptionMethod A256CBC_HS512.
Since:
2.5.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Constructs a new RSA15AES256CBCHS512EncryptionHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    decryptCiphertext(Key contentEncryptionKey, byte[] initialisationVector, byte[] ciphertext, byte[] authenticationTag, byte[] additionalAuthenticatedData)
    Deprecated.
    Decrypts the ciphertext with the Content Encryption Key, using the initialisation vector and additional authenticated data, following the steps defined by the EncryptionHandler JweAlgorithm.
    decryptContentEncryptionKey(Key key, byte[] encryptedContentEncryptionKey)
    Deprecated.
    Decrypts the JWE Encrypted Key to produce the Content Encryption Key (CEK).
    decryptContentEncryptionKey(Key key, byte[] encryptedContentEncryptionKey, JweHeader header)
    Deprecated.
    Decrypts the JWE Encrypted Key to produce the Content Encryption Key (CEK).
    encryptPlaintext(Key contentEncryptionKey, byte[] initialisationVector, byte[] plaintext, byte[] additionalAuthenticatedData)
    Deprecated.
    Encrypts the plaintext with the Content Encryption Key, using the initialisation vector and additional authenticated data, following the steps defined by the EncryptionHandler JweAlgorithm.
    byte[]
    Deprecated.
    Generates a random JWE Initialisation Vector of the correct size for the encryption algorithm.
    byte[]
    generateJWEEncryptedKey(Key key, Key contentEncryptionKey)
    Deprecated.
    Generates the JWE Encrypted Key by encrypting the Content Encryption Key (CEK) using the JweAlgorithm RSAES_PCKCS1_V1_5.
    byte[]
    generateJWEEncryptedKey(Key key, Key contentEncryptionKey, JweHeader header)
    Deprecated.
    Generates the JWE Encrypted Key by encrypting the Content Encryption Key (CEK) using the JweAlgorithm RSAES_PCKCS1_V1_5.
    Deprecated.
    Creates a Content Encryption Key (CEK) by generating a random key value with a length equal to the EncryptionMethod A128CBC_HS256 key size.

    Methods inherited from class org.forgerock.json.jose.jwe.handlers.encryption.AbstractEncryptionHandler

    decrypt, decrypt, encrypt, encrypt

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RSA15AES256CBCHS512EncryptionHandler

      public RSA15AES256CBCHS512EncryptionHandler(SigningManager signingManager)
      Deprecated.
      Constructs a new RSA15AES256CBCHS512EncryptionHandler.
      Parameters:
      signingManager - A SigningManager instance.
  • Method Details

    • getContentEncryptionKey

      public Key getContentEncryptionKey()
      Deprecated.
      Creates a Content Encryption Key (CEK) by generating a random key value with a length equal to the EncryptionMethod A128CBC_HS256 key size.

      See point 2 in Section 5.1 of the JWE Specification.

      Returns:
      The Content Encryption Key or null if the shared key should be used directly.
    • generateJWEEncryptedKey

      public byte[] generateJWEEncryptedKey(Key key, Key contentEncryptionKey)
      Deprecated.
      Generates the JWE Encrypted Key by encrypting the Content Encryption Key (CEK) using the JweAlgorithm RSAES_PCKCS1_V1_5.

      See point 4 in Section 5.1 of the JWE Specification.

      Parameters:
      key - The key to use to encrypt the Content Encryption Key, if the EncryptionHandler JweAlgorithm requires.
      contentEncryptionKey - The Content Encryption Key (CEK).
      Returns:
      A byte array of the JWE Encrypted Key.
    • generateJWEEncryptedKey

      public byte[] generateJWEEncryptedKey(Key key, Key contentEncryptionKey, JweHeader header)
      Deprecated.
      Generates the JWE Encrypted Key by encrypting the Content Encryption Key (CEK) using the JweAlgorithm RSAES_PCKCS1_V1_5.

      See point 4 in Section 5.1 of the JWE Specification.

      Parameters:
      key - The key to use to encrypt the Content Encryption Key, if the EncryptionHandler JweAlgorithm requires.
      contentEncryptionKey - The Content Encryption Key (CEK).
      header - The JWE header.
      Returns:
      A byte array of the JWE Encrypted Key.
    • generateInitialisationVector

      public byte[] generateInitialisationVector()
      Deprecated.
      Generates a random JWE Initialisation Vector of the correct size for the encryption algorithm.

      See points 9 in Section 5.1 of the JWE Specification.

      Returns:
      The Initialisation Vector.
    • encryptPlaintext

      public JweEncryption encryptPlaintext(Key contentEncryptionKey, byte[] initialisationVector, byte[] plaintext, byte[] additionalAuthenticatedData)
      Deprecated.
      Encrypts the plaintext with the Content Encryption Key, using the initialisation vector and additional authenticated data, following the steps defined by the EncryptionHandler JweAlgorithm.

      See points 15, 16 in Section 5.1 of the JWE Specification.

      Parameters:
      contentEncryptionKey - The Content Encryption Key.
      initialisationVector - The Initialisation Vector.
      plaintext - The plaintext to encrypt.
      additionalAuthenticatedData - An array of bytes representing the additional authenticated data.
      Returns:
      The JweEncryption object containing the ciphertext and authentication tag.
    • decryptContentEncryptionKey

      public Key decryptContentEncryptionKey(Key key, byte[] encryptedContentEncryptionKey)
      Deprecated.
      Decrypts the JWE Encrypted Key to produce the Content Encryption Key (CEK).

      See points 10 in Section 5.2 of the JWE Specification.

      Parameters:
      key - The private key pair to the public key that encrypted the JWT.
      encryptedContentEncryptionKey - The encrypted Content Encryption Key.
      Returns:
      The decrypted Content Encryption Key.
    • decryptContentEncryptionKey

      public Key decryptContentEncryptionKey(Key key, byte[] encryptedContentEncryptionKey, JweHeader header)
      Deprecated.
      Decrypts the JWE Encrypted Key to produce the Content Encryption Key (CEK).

      See points 10 in Section 5.2 of the JWE Specification.

      Parameters:
      key - The private key pair to the public key that encrypted the JWT.
      encryptedContentEncryptionKey - The encrypted Content Encryption Key.
      header - The JWE header.
      Returns:
      The decrypted Content Encryption Key.
    • decryptCiphertext

      public byte[] decryptCiphertext(Key contentEncryptionKey, byte[] initialisationVector, byte[] ciphertext, byte[] authenticationTag, byte[] additionalAuthenticatedData)
      Deprecated.
      Decrypts the ciphertext with the Content Encryption Key, using the initialisation vector and additional authenticated data, following the steps defined by the EncryptionHandler JweAlgorithm.

      See points 14, 15 in Section 5.2 of the JWE Specification.

      Parameters:
      contentEncryptionKey - The Content Encryption Key.
      initialisationVector - The Initialisation Vector.
      ciphertext - The ciphertext to decrypt.
      authenticationTag - The authentication tag.
      additionalAuthenticatedData - An array of bytes representing the additional authenticated data.
      Returns:
      An array of bytes representing the decrypted ciphertext.