Interface SwitchableEncryptor

All Superinterfaces:
Encryptor
All Known Implementing Classes:
ClusterLockingEncryptor, PrefixBasedSwitchableEncryptor

public interface SwitchableEncryptor extends Encryptor
Encryptor which can be backed by more than one Encryptor.
  • Method Details

    • switchEncryptor

      void switchEncryptor(@Nullable String encryptorKey)
      Switches the Encryptor to the one specified by encryptorKey or disable encryption when encryptorKey is null.
      Parameters:
      encryptorKey - identifies one of the Encryptor or no encryption when null.
      Throws:
      IllegalArgumentException - if provided encryptorKey is not available
    • getAvailableEncryptorKeys

      Collection<String> getAvailableEncryptorKeys()
      Returns:
      available encryptors' keys
    • getCurrentEncryptorKey

      Optional<String> getCurrentEncryptorKey()
      Returns:
      key of the currently used Encryptor or Optional.empty() when encryption is disabled