Package org.apache.nifi.encrypt
Class CipherPropertyEncryptor
java.lang.Object
org.apache.nifi.encrypt.CipherPropertyEncryptor
- All Implemented Interfaces:
PropertyEncryptor
- Direct Known Subclasses:
KeyedCipherPropertyEncryptor
Cipher Property Encryptor provides hexadecimal encoding and decoding around cipher operations
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrypt property from a hexadecimal stringEncrypt property and encode as a hexadecimal stringprotected abstract byte[]getCipherBinary(byte[] encryptedBinary) Get Cipher Binary from encrypted binaryprivate byte[]getConcatenatedBinary(byte[] encodedParameters, byte[] encrypted) private byte[]getDecodedBinary(String encryptedProperty) protected abstract CiphergetDecryptionCipher(byte[] encryptedBinary) Get Cipher for Decryption based on encrypted binaryprotected abstract byte[]Get Encoded Parameters based on cipher implementationprotected abstract CiphergetEncryptionCipher(byte[] encodedParameters) Get Cipher for Encryption using encoded parameters
-
Field Details
-
PROPERTY_CHARSET
-
-
Constructor Details
-
CipherPropertyEncryptor
CipherPropertyEncryptor()
-
-
Method Details
-
encrypt
Encrypt property and encode as a hexadecimal string- Specified by:
encryptin interfacePropertyEncryptor- Parameters:
property- Property value to be encrypted- Returns:
- Encrypted and hexadecimal string
-
decrypt
Decrypt property from a hexadecimal string- Specified by:
decryptin interfacePropertyEncryptor- Parameters:
encryptedProperty- Encrypted property value to be deciphered- Returns:
- Property decoded from hexadecimal string and deciphered from binary
-
getDecodedBinary
-
getConcatenatedBinary
private byte[] getConcatenatedBinary(byte[] encodedParameters, byte[] encrypted) -
getEncodedParameters
protected abstract byte[] getEncodedParameters()Get Encoded Parameters based on cipher implementation- Returns:
- Encoded Parameters
-
getEncryptionCipher
Get Cipher for Encryption using encoded parameters- Parameters:
encodedParameters- Binary encoded parameters- Returns:
- Cipher for Encryption
-
getDecryptionCipher
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
-