Class AbstractEncryptionHandler

java.lang.Object
org.forgerock.json.jose.jwe.handlers.encryption.AbstractEncryptionHandler
All Implemented Interfaces:
EncryptionHandler
Direct Known Subclasses:
RSA15AES128CBCHS256EncryptionHandler, RSA15AES256CBCHS512EncryptionHandler

@Deprecated public abstract class AbstractEncryptionHandler extends Object implements EncryptionHandler
Deprecated.
Use ContentEncryptionHandler instead.
A base implementation of an EncryptionHandler that provides common encryption and decryption methods for all concrete EncryptionHandler implementations.
Since:
2.0.0
  • Constructor Details

    • AbstractEncryptionHandler

      public AbstractEncryptionHandler()
      Deprecated.
  • Method Details

    • encrypt

      protected byte[] encrypt(String algorithm, Key key, byte[] data)
      Deprecated.
      Encrypts the given plaintext using the specified key with the specified encryption algorithm.
      Parameters:
      algorithm - The Java Cryptographic encryption algorithm.
      key - The encryption key.
      data - The data to encrypt.
      Returns:
      An array of bytes representing the encrypted data.
    • encrypt

      protected byte[] encrypt(String algorithm, Key key, byte[] initialisationVector, byte[] data)
      Deprecated.
      Encrypts the given plaintext using the specified key and initialisation vector with the specified encryption algorithm.
      Parameters:
      algorithm - The Java Cryptographic encryption algorithm.
      key - The encryption key.
      initialisationVector - The initialisation vector.
      data - The data to encrypt.
      Returns:
      An array of bytes representing the encrypted data.
    • decrypt

      public byte[] decrypt(String algorithm, Key privateKey, byte[] data)
      Deprecated.
      Decrypts the given ciphertext using the private key and with the same encryption algorithm that was used in the encryption.
      Parameters:
      algorithm - The Java Cryptographic encryption algorithm.
      privateKey - The private key pair to the public key used in the encryption.
      data - The ciphertext to decrypt.
      Returns:
      An array of bytes representing the decrypted data.
    • decrypt

      protected byte[] decrypt(String algorithm, Key key, byte[] initialisationVector, byte[] data)
      Deprecated.
      Decrypts the given ciphertext using the private key and initialisation vector with the same encryption algorithm that was used in the encryption.
      Parameters:
      algorithm - The Java Cryptographic encryption algorithm.
      key - The private key pair to the public key used in the encryption.
      initialisationVector - The same initialisation vector that was used in the encryption.
      data - The ciphertext to decrypt.
      Returns:
      An array of bytes representing the decrypted data.