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 boolean
allowNonFIPSInFIPSMode()
Indicates whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.java.lang.String
getCertificateAlias()
Retrieves the alias (nickname) of the certificate chain to use in the target key store, if specified.java.lang.String
getKeyStoreFormat()
Retrieves the format for the target key store, if specified.java.lang.String
getKeyStorePath()
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.Provider
getProvider()
Retrieves the security provider to use to access the key store, if a non-default provider should be used.void
setAllowNonFIPSInFIPSMode(boolean allowNonFIPSInFIPSMode)
Specifies whether to allow access to a non-FIPS-compliant key store even when operating in FIPS-compliant mode.void
setCertificateAlias(java.lang.String certificateAlias)
Specifies the alias (nickname) of the certificate chain ot use in the target key store.void
setKeyStoreFile(java.io.File keyStoreFile)
Specifies the target key store file.void
setKeyStoreFormat(java.lang.String keyStoreFormat)
Specifies the format for the target key store.void
setKeyStorePath(java.lang.String keyStorePath)
Specifies the path to the target key store file.void
setKeyStorePIN(char[] keyStorePIN)
Specifies the PIN needed to access the contents of the key store.void
setKeyStorePIN(java.lang.String keyStorePIN)
Specifies the PIN needed to access the contents of the key store.void
setProvider(java.security.Provider provider)
Specifies the security provider to use to access the key store.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.java.lang.String
toString()
Retrieves a string representation of these properties.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of these properties to the provided buffer.boolean
validateKeyStore()
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
null
if 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 benull
if 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 benull
if 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
null
if 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 benull
if 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
null
if 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 benull
if 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:
true
if the key store should be validated before attempting to use it, orfalse
if 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
null
if 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 benull
if 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:
true
if access to a non-FIPS-compliant key store should be allowed even when operating in FIPS-compliant mode, orfalse
if 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:
toString
in classjava.lang.Object
- Returns:
- A string representation of these properties.
-
-