Package com.unboundid.util.ssl
Class KeyStoreKeyManagerProperties
- java.lang.Object
-
- com.unboundid.util.ssl.KeyStoreKeyManagerProperties
-
- All Implemented Interfaces:
java.io.Serializable
@Mutable @ThreadSafety(level=NOT_THREADSAFE) public final class KeyStoreKeyManagerProperties extends java.lang.Object implements java.io.Serializable
This class provides a data structure with information about properties to use when accessing theKeyStoreKeyManager.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyStoreKeyManagerProperties(java.io.File keyStoreFile)Creates a new set of key manage provider properties for the specified key store file.KeyStoreKeyManagerProperties(java.lang.String keyStorePath)Creates a new set of key manage provider properties for the specified key store file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowNonFIPSInFIPSMode()Indicates whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.java.lang.StringgetCertificateAlias()Retrieves the alias (nickname) of the certificate chain to use in the target key store, if specified.java.lang.StringgetKeyStoreFormat()Retrieves the format for the target key store, if specified.java.lang.StringgetKeyStorePath()Retrieves the path to the target key store file.char[]getKeyStorePIN()Retrieves the PIN needed to access the contents of the key store, if specified.java.security.ProvidergetProvider()Retrieves the security provider to use to access the key store, if a non-default provider should be used.voidsetAllowNonFIPSInFIPSMode(boolean allowNonFIPSInFIPSMode)Specifies whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.voidsetCertificateAlias(java.lang.String certificateAlias)Specifies the alias (nickname) of the certificate chain ot use in the target key store.voidsetKeyStoreFile(java.io.File keyStoreFile)Specifies the target key store file.voidsetKeyStoreFormat(java.lang.String keyStoreFormat)Specifies the format for the target key store.voidsetKeyStorePath(java.lang.String keyStorePath)Specifies the path to the target key store file.voidsetKeyStorePIN(char[] keyStorePIN)Specifies the PIN needed to access the contents of the key store.voidsetKeyStorePIN(java.lang.String keyStorePIN)Specifies the PIN needed to access the contents of the key store.voidsetProvider(java.security.Provider provider)Specifies the security provider to use to access the key store.voidsetValidateKeyStore(boolean validateKeyStore)Specifies whether to validate that the provided key store is acceptable and can actually be used to obtain a valid certificate chain.java.lang.StringtoString()Retrieves a string representation of these properties.voidtoString(java.lang.StringBuilder buffer)Appends a string representation of these properties to the provided buffer.booleanvalidateKeyStore()Indicates whether to validate that the provided key store is acceptable and can actually be used to obtain a valid certificate chain.
-
-
-
Constructor Detail
-
KeyStoreKeyManagerProperties
public KeyStoreKeyManagerProperties(@NotNull java.io.File keyStoreFile)
Creates a new set of key manage provider properties for the specified key store file.- Parameters:
keyStoreFile- The target key store file. It must not benull.
-
KeyStoreKeyManagerProperties
public KeyStoreKeyManagerProperties(@NotNull java.lang.String keyStorePath)
Creates a new set of key manage provider properties for the specified key store file.- Parameters:
keyStorePath- The path to the target key store file. It must not benull.
-
-
Method Detail
-
getKeyStorePath
@NotNull public java.lang.String getKeyStorePath()
Retrieves the path to the target key store file.- Returns:
- The path to the target key store file.
-
setKeyStoreFile
public void setKeyStoreFile(@NotNull java.io.File keyStoreFile)
Specifies the target key store file.- Parameters:
keyStoreFile- The target key store file. It must not benull.
-
setKeyStorePath
public void setKeyStorePath(@NotNull java.lang.String keyStorePath)
Specifies the path to the target key store file.- Parameters:
keyStorePath- The path to the target key store file. It must not benull.
-
getKeyStorePIN
@Nullable public char[] getKeyStorePIN()
Retrieves the PIN needed to access the contents of the key store, if specified.- Returns:
- The PIN needed to access the contents of the key store, or
nullif none has been specified.
-
setKeyStorePIN
public void setKeyStorePIN(@Nullable char[] keyStorePIN)
Specifies the PIN needed to access the contents of the key store.- Parameters:
keyStorePIN- The PIN needed to access the contents of the key store. It may benullif no PIN is needed.
-
setKeyStorePIN
public void setKeyStorePIN(@Nullable java.lang.String keyStorePIN)
Specifies the PIN needed to access the contents of the key store.- Parameters:
keyStorePIN- The PIN needed to access the contents of the key store. It may benullif no PIN is needed.
-
getKeyStoreFormat
@Nullable public java.lang.String getKeyStoreFormat()
Retrieves the format for the target key store, if specified.- Returns:
- The format for the target key store, or
nullif a default format should be used.
-
setKeyStoreFormat
public void setKeyStoreFormat(@Nullable java.lang.String keyStoreFormat)
Specifies the format for the target key store.- Parameters:
keyStoreFormat- The format for the target key store. It may benullif a default format should be used.
-
getCertificateAlias
@Nullable public java.lang.String getCertificateAlias()
Retrieves the alias (nickname) of the certificate chain to use in the target key store, if specified.- Returns:
- The alias of the certificate chain to use in the target key store,
or
nullif any acceptable certificate found in the key store may be used.
-
setCertificateAlias
public void setCertificateAlias(@Nullable java.lang.String certificateAlias)
Specifies the alias (nickname) of the certificate chain ot use in the target key store.- Parameters:
certificateAlias- The alias of the certificate chain to use in the target key store. It may benullif any acceptable certificate found in the key store may be used.
-
validateKeyStore
public boolean validateKeyStore()
Indicates whether to validate that the provided key store is acceptable and can actually be used to obtain a valid certificate chain.- Returns:
trueif the key store should be validated before attempting to use it, orfalseif not.
-
setValidateKeyStore
public void setValidateKeyStore(boolean validateKeyStore)
Specifies whether to validate that the provided key store is acceptable and can actually be used to obtain a valid certificate chain.- Parameters:
validateKeyStore- Indicates whether to validate that the provided key store is acceptable and can actually be used to obtain a valid certificate chain. If a certificate alias was specified, then this will ensure that the key store contains a valid private key entry with that alias. If no certificate alias was specified, then this will ensure that the key store contains at least one valid private key entry.
-
getProvider
@Nullable public java.security.Provider getProvider()
Retrieves the security provider to use to access the key store, if a non-default provider should be used.- Returns:
- The security provider to use to access the key store, or
nullif a default provider should be used.
-
setProvider
public void setProvider(@Nullable java.security.Provider provider)
Specifies the security provider to use to access the key store.- Parameters:
provider- The security provider to use to access the key store. It may benullif a default provider should be used.
-
allowNonFIPSInFIPSMode
public boolean allowNonFIPSInFIPSMode()
Indicates whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.- Returns:
trueif access to a non-FIPS-compliant key store should be allowed even when operating in FIPS-compliant mode, orfalseif not.
-
setAllowNonFIPSInFIPSMode
public void setAllowNonFIPSInFIPSMode(boolean allowNonFIPSInFIPSMode)
Specifies whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.- Parameters:
allowNonFIPSInFIPSMode- Indicates whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.
-
toString
@NotNull public java.lang.String toString()
Retrieves a string representation of these properties.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of these properties.
-
-