Class CipherPropertyEncryptor

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

abstract class CipherPropertyEncryptor extends Object implements PropertyEncryptor
Cipher Property Encryptor provides hexadecimal encoding and decoding around cipher operations
  • Field Details

    • PROPERTY_CHARSET

      private static final Charset PROPERTY_CHARSET
  • Constructor Details

    • CipherPropertyEncryptor

      CipherPropertyEncryptor()
  • Method Details

    • encrypt

      public String encrypt(String property)
      Encrypt property and encode as a hexadecimal string
      Specified by:
      encrypt in interface PropertyEncryptor
      Parameters:
      property - Property value to be encrypted
      Returns:
      Encrypted and hexadecimal string
    • decrypt

      public String decrypt(String encryptedProperty)
      Decrypt property from a hexadecimal string
      Specified by:
      decrypt in interface PropertyEncryptor
      Parameters:
      encryptedProperty - Encrypted property value to be deciphered
      Returns:
      Property decoded from hexadecimal string and deciphered from binary
    • getDecodedBinary

      private byte[] getDecodedBinary(String encryptedProperty)
    • getConcatenatedBinary

      private byte[] getConcatenatedBinary(byte[] encodedParameters, byte[] encrypted)
    • getEncodedParameters

      protected abstract byte[] getEncodedParameters()
      Get Encoded Parameters based on cipher implementation
      Returns:
      Encoded Parameters
    • getEncryptionCipher

      protected abstract Cipher getEncryptionCipher(byte[] encodedParameters)
      Get Cipher for Encryption using encoded parameters
      Parameters:
      encodedParameters - Binary encoded parameters
      Returns:
      Cipher for Encryption
    • getDecryptionCipher

      protected abstract Cipher getDecryptionCipher(byte[] encryptedBinary)
      Get Cipher for Decryption based on encrypted binary
      Parameters:
      encryptedBinary - Encrypted Binary
      Returns:
      Cipher for Decryption
    • getCipherBinary

      protected abstract byte[] getCipherBinary(byte[] encryptedBinary)
      Get Cipher Binary from encrypted binary
      Parameters:
      encryptedBinary - Encrypted Binary containing cipher binary and other information
      Returns:
      Cipher Binary for decryption