Class KeyedCipherPropertyEncryptor

java.lang.Object
org.apache.nifi.encrypt.CipherPropertyEncryptor
org.apache.nifi.encrypt.KeyedCipherPropertyEncryptor
All Implemented Interfaces:
PropertyEncryptor

class KeyedCipherPropertyEncryptor extends CipherPropertyEncryptor
Property Encryptor implementation using AES-GCM
  • Field Details

  • Constructor Details

    • KeyedCipherPropertyEncryptor

      protected KeyedCipherPropertyEncryptor(SecretKey secretKey)
  • Method Details

    • getDecryptionCipher

      protected Cipher getDecryptionCipher(byte[] encryptedBinary)
      Get Cipher for Decryption based on encrypted binary
      Specified by:
      getDecryptionCipher in class CipherPropertyEncryptor
      Parameters:
      encryptedBinary - Encrypted Binary
      Returns:
      Cipher for Decryption
    • getEncryptionCipher

      protected Cipher getEncryptionCipher(byte[] encodedParameters)
      Get Cipher for Encryption using encoded parameters containing initialization vector
      Specified by:
      getEncryptionCipher in class CipherPropertyEncryptor
      Parameters:
      encodedParameters - Binary encoded parameters containing random initialization vector
      Returns:
      Cipher for Encryption
    • getCipherBinary

      protected byte[] getCipherBinary(byte[] encryptedBinary)
      Get Cipher Binary from encrypted binary
      Specified by:
      getCipherBinary in class CipherPropertyEncryptor
      Parameters:
      encryptedBinary - Encrypted Binary containing cipher binary and other information
      Returns:
      Cipher Binary for decryption
    • getEncodedParameters

      protected byte[] getEncodedParameters()
      Get Encoded Parameters returns a random initialization vector
      Specified by:
      getEncodedParameters in class CipherPropertyEncryptor
      Returns:
      Initialization Vector for encoded parameters
    • getCipher

      private Cipher getCipher(byte[] initializationVector, int cipherMode)
    • readInitializationVector

      private byte[] readInitializationVector(byte[] binary)
    • equals

      public boolean equals(Object object)
      Return object equality based on Secret Key
      Overrides:
      equals in class Object
      Parameters:
      object - Object for comparison
      Returns:
      Object equality status
    • hashCode

      public int hashCode()
      Return hash code based on Secret Key
      Overrides:
      hashCode in class Object
      Returns:
      Hash Code based on Secret Key
    • toString

      public String toString()
      Return String containing object description
      Overrides:
      toString in class Object
      Returns:
      Object description