Package com.hazelcast.config
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()
, andgetPassword()
, 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.
Only file-based KeyStores are supported.
- If an alias for the current encryption key is set (see
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_KEYSTORE_TYPE
The default Java KeyStore type (PKCS12).static int
DEFAULT_POLLING_INTERVAL
Default interval (in seconds) for polling for changes in the KeyStore: 0 (polling disabled).
-
Constructor Summary
Constructors Constructor Description JavaKeyStoreSecureStoreConfig()
Creates a new Java KeyStore Secure Store configuration.JavaKeyStoreSecureStoreConfig(java.io.File path)
Creates a new Java KeyStore Secure Store configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getCurrentKeyAlias()
Returns the alias for the current encryption key entry ornull
if no alias is set.java.lang.String
getPassword()
Returns the Java KeyStore password.java.io.File
getPath()
Returns the Java KeyStore file path.int
getPollingInterval()
Returns the polling interval (in seconds) for checking for changes in the KeyStore.java.lang.String
getType()
Returns the type of the Java KeyStore.int
hashCode()
JavaKeyStoreSecureStoreConfig
setCurrentKeyAlias(java.lang.String currentKeyAlias)
Sets the alias for the current encryption key entry.JavaKeyStoreSecureStoreConfig
setPassword(java.lang.String password)
Sets the Java KeyStore password.JavaKeyStoreSecureStoreConfig
setPath(java.io.File path)
Sets the Java KeyStore file path.JavaKeyStoreSecureStoreConfig
setPollingInterval(int pollingInterval)
Sets the polling interval (in seconds) for checking for changes in the KeyStore.JavaKeyStoreSecureStoreConfig
setType(java.lang.String type)
Sets the Java KeyStore type (PKCS12, JCEKS etc.)java.lang.String
toString()
-
-
-
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
-
setPath
public JavaKeyStoreSecureStoreConfig setPath(java.io.File path)
Sets the Java KeyStore file path.- Parameters:
path
- the file path- Returns:
- the updated
JavaKeyStoreSecureStoreConfig
instance - Throws:
java.lang.IllegalArgumentException
- if path is {code null}
-
getPassword
public java.lang.String getPassword()
Returns the Java KeyStore password.- Returns:
- the password
-
setPassword
public JavaKeyStoreSecureStoreConfig setPassword(java.lang.String password)
Sets the Java KeyStore password.- Parameters:
password
- the KeyStore password- Returns:
- the updated
JavaKeyStoreSecureStoreConfig
instance
-
getCurrentKeyAlias
public java.lang.String getCurrentKeyAlias()
Returns the alias for the current encryption key entry ornull
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 ornull
- 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 classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-