Package org.apache.nifi.properties
Class EncodedSensitivePropertyProvider
java.lang.Object
org.apache.nifi.properties.EncodedSensitivePropertyProvider
- All Implemented Interfaces:
SensitivePropertyProvider
- Direct Known Subclasses:
ClientBasedEncodedSensitivePropertyProvider
public abstract class EncodedSensitivePropertyProvider
extends Object
implements SensitivePropertyProvider
Encoded Sensitive Property Provider handles Base64 encoding and decoding of property values
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Base64.Decoderprivate static final Base64.Encoderprivate static final Charset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract byte[]getDecrypted(byte[] bytes) Get decrypted byte array representation of encrypted bytesprotected abstract byte[]getEncrypted(byte[] bytes) Get encrypted byte array representation of bytesprotect(String unprotectedValue, ProtectedPropertyContext context) Protect property value and return Base64-encoded representation of encrypted bytesunprotect(String protectedValue, ProtectedPropertyContext context) Unprotect Base64-encoded representation of encrypted property value and return stringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.nifi.properties.SensitivePropertyProvider
cleanUp, getIdentifierKey, isSupported
-
Field Details
-
VALUE_CHARACTER_SET
-
ENCODER
-
DECODER
-
-
Constructor Details
-
EncodedSensitivePropertyProvider
public EncodedSensitivePropertyProvider()
-
-
Method Details
-
protect
Protect property value and return Base64-encoded representation of encrypted bytes- Specified by:
protectin interfaceSensitivePropertyProvider- Parameters:
unprotectedValue- Unprotected property value to be encryptedcontext- Property Context- Returns:
- Base64-encoded representation of encrypted bytes
-
unprotect
Unprotect Base64-encoded representation of encrypted property value and return string- Specified by:
unprotectin interfaceSensitivePropertyProvider- Parameters:
protectedValue- Base64-encoded representation of encrypted bytescontext- Property Context- Returns:
- Decrypted property value string
-
getEncrypted
protected abstract byte[] getEncrypted(byte[] bytes) Get encrypted byte array representation of bytes- Parameters:
bytes- Unprotected bytes- Returns:
- Encrypted bytes
-
getDecrypted
protected abstract byte[] getDecrypted(byte[] bytes) Get decrypted byte array representation of encrypted bytes- Parameters:
bytes- Encrypted bytes- Returns:
- Decrypted bytes
-