Class JavaKeyStoreSecureStoreConfig

java.lang.Object
com.hazelcast.config.SecureStoreConfig
com.hazelcast.config.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 Details

    • DEFAULT_KEYSTORE_TYPE

      public static final String DEFAULT_KEYSTORE_TYPE
      The default Java KeyStore type (PKCS12).
      See Also:
    • 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:
  • Constructor Details

    • JavaKeyStoreSecureStoreConfig

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

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

    • getType

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

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

      public File getPath()
      Returns the Java KeyStore file path.
      Returns:
      the file path
    • setPath

      public JavaKeyStoreSecureStoreConfig setPath(File path)
      Sets the Java KeyStore file path.
      Parameters:
      path - the file path
      Returns:
      the updated JavaKeyStoreSecureStoreConfig instance
      Throws:
      IllegalArgumentException - if path is {code null}
    • getPassword

      public String getPassword()
      Returns the Java KeyStore password.
      Returns:
      the password
    • setPassword

      public JavaKeyStoreSecureStoreConfig setPassword(String password)
      Sets the Java KeyStore password.
      Parameters:
      password - the KeyStore password
      Returns:
      the updated JavaKeyStoreSecureStoreConfig instance
    • getCurrentKeyAlias

      public 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(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:
      IllegalArgumentException - if pollingInterval is less than zero
    • toString

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

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object