Class JavaKeyStoreSecureStoreConfig


  • public class JavaKeyStoreSecureStoreConfig
    extends SecureStoreConfig
    Java KeyStore Secure Store configuration.

    The Java KeyStore Secure Store exposes (symmetric) encryption keys stored in a Java KeyStore with path, type, and password as specified by getType(), getPath(), and getPassword(), respectively. The Java KeyStore SecureStore loads all symmetric keys available in the KeyStore and treats them as versions of a single key. More specifically:

    • If an alias for the current encryption key is set (see setCurrentKeyAlias(String)), the corresponding KeyStore entry is treated as the current version of the encryption key, while any other entries are treated as historical versions of the encryption key.
    • If an alias for the current encryption key is not set, the KeyStore entry with an alias that comes last in alphabetical order is treated as the current version of the encryption key, while any other entries are treated as historical versions of the encryption key.
    • The KeyStore entries are expected to use the same password as the KeyStore.
    The Java KeyStore can also poll the KeyStore for changes at preconfigured interval (disabled by default).

    Only file-based KeyStores are supported.

    • Field Detail

      • DEFAULT_KEYSTORE_TYPE

        public static final java.lang.String DEFAULT_KEYSTORE_TYPE
        The default Java KeyStore type (PKCS12).
        See Also:
        Constant Field Values
      • DEFAULT_POLLING_INTERVAL

        public static final int DEFAULT_POLLING_INTERVAL
        Default interval (in seconds) for polling for changes in the KeyStore: 0 (polling disabled).
        See Also:
        Constant Field Values
    • Constructor Detail

      • JavaKeyStoreSecureStoreConfig

        public JavaKeyStoreSecureStoreConfig()
        Creates a new Java KeyStore Secure Store configuration.
      • JavaKeyStoreSecureStoreConfig

        public JavaKeyStoreSecureStoreConfig​(java.io.File path)
        Creates a new Java KeyStore Secure Store configuration.
        Parameters:
        path - the KeyStore file path
    • Method Detail

      • getType

        public java.lang.String getType()
        Returns the type of the Java KeyStore.
        Returns:
        the Java KeyStore type
      • setType

        public JavaKeyStoreSecureStoreConfig setType​(java.lang.String type)
        Sets the Java KeyStore type (PKCS12, JCEKS etc.)
        Parameters:
        type - the KeyStore type
        Returns:
        the updated JavaKeyStoreSecureStoreConfig instance
        Throws:
        java.lang.IllegalArgumentException - if type is {code null}
      • getPath

        public java.io.File getPath()
        Returns the Java KeyStore file path.
        Returns:
        the file path
      • getPassword

        public java.lang.String getPassword()
        Returns the Java KeyStore password.
        Returns:
        the password
      • getCurrentKeyAlias

        public java.lang.String getCurrentKeyAlias()
        Returns the alias for the current encryption key entry or null if no alias is set.
        Returns:
        the alias or null
      • setCurrentKeyAlias

        public JavaKeyStoreSecureStoreConfig setCurrentKeyAlias​(java.lang.String currentKeyAlias)
        Sets the alias for the current encryption key entry.
        Parameters:
        currentKeyAlias - the alias for the current encryption key or null
        Returns:
        the updated JavaKeyStoreSecureStoreConfig instance
      • getPollingInterval

        public int getPollingInterval()
        Returns the polling interval (in seconds) for checking for changes in the KeyStore.
        Returns:
        the polling interval
      • setPollingInterval

        public JavaKeyStoreSecureStoreConfig setPollingInterval​(int pollingInterval)
        Sets the polling interval (in seconds) for checking for changes in the KeyStore. The value 0 disables polling.
        Parameters:
        pollingInterval - the polling interval
        Returns:
        the updated JavaKeyStoreSecureStoreConfig instance
        Throws:
        java.lang.IllegalArgumentException - if pollingInterval is less than zero
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object