Class CipherCodec


  • public abstract class CipherCodec
    extends Object
    A crypto RedisCodec that that allows transparent encryption/decryption of values. This codec uses Cipher instances provided by CipherCodec.CipherSupplier to process encryption and decryption.

    This codec supports various encryption keys by encoding the key name and used key version in the value that is stored in Redis. The message format for encryption is:

         $<key name>+<key version>$<cipher text>
     
    Each value is prefixed with the key message that is enclosed with dollar ($) signs and using the plus sign (+) to denote the key version. Decryption decodes the key name and requests a Cipher from CipherCodec.CipherSupplier to decrypt values with an appropriate key/Cipher.

    This codec does not provide re-wrapping or key rotation features.

    Since:
    5.2
    Author:
    Mark Paluch
    See Also:
    CipherCodec.CipherSupplier, CipherCodec.KeyDescriptor