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 Details

    • VALUE_CHARACTER_SET

      private static final Charset VALUE_CHARACTER_SET
    • ENCODER

      private static final Base64.Encoder ENCODER
    • DECODER

      private static final Base64.Decoder DECODER
  • Constructor Details

    • EncodedSensitivePropertyProvider

      public EncodedSensitivePropertyProvider()
  • Method Details

    • protect

      public String protect(String unprotectedValue, ProtectedPropertyContext context)
      Protect property value and return Base64-encoded representation of encrypted bytes
      Specified by:
      protect in interface SensitivePropertyProvider
      Parameters:
      unprotectedValue - Unprotected property value to be encrypted
      context - Property Context
      Returns:
      Base64-encoded representation of encrypted bytes
    • unprotect

      public String unprotect(String protectedValue, ProtectedPropertyContext context)
      Unprotect Base64-encoded representation of encrypted property value and return string
      Specified by:
      unprotect in interface SensitivePropertyProvider
      Parameters:
      protectedValue - Base64-encoded representation of encrypted bytes
      context - 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