public class BaseTlsManager
extends java.lang.Object
Constructor and Description |
---|
BaseTlsManager(TlsConfig tlsConfig) |
BaseTlsManager(TlsConfig tlsConfig,
PasswordUtil passwordUtil,
InputStreamFactory inputStreamFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addConfigurationWriter(ConfigurationWriter<TlsConfig> configurationWriter)
Adds a ConfigurationWriter which will have an opportunity to write configuration information
|
java.security.KeyStore.Entry |
addPrivateKeyToKeyStore(java.security.KeyPair keyPair,
java.lang.String alias,
java.security.cert.Certificate... certificates)
Adds the private key of the KeyPair to the KeyStore and returns the entry
|
java.security.KeyStore.Entry |
getEntry(java.lang.String alias)
Returns an entry from the KeyStore with the given alias
|
java.security.KeyStore |
getKeyStore()
Returns the KeyStore
|
protected PasswordUtil |
getPasswordUtil() |
protected TlsConfig |
getTlsConfig() |
protected java.security.KeyStore |
loadKeystore(java.lang.String keyStore,
java.lang.String keyStoreType,
java.lang.String keyStorePassword) |
void |
setDifferentKeyAndKeyStorePassword(boolean differentKeyAndKeyStorePassword)
Sets a flag indicating whether to use a different key and keystore password
|
void |
write(OutputStreamFactory outputStreamFactory)
Writes the KeyStore and configuration information
|
public BaseTlsManager(TlsConfig tlsConfig) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public BaseTlsManager(TlsConfig tlsConfig, PasswordUtil passwordUtil, InputStreamFactory inputStreamFactory) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public java.security.KeyStore getKeyStore()
public java.security.KeyStore.Entry getEntry(java.lang.String alias) throws java.security.GeneralSecurityException
alias
- the aliasjava.security.GeneralSecurityException
- if there is a problem retrieving the entrypublic java.security.KeyStore.Entry addPrivateKeyToKeyStore(java.security.KeyPair keyPair, java.lang.String alias, java.security.cert.Certificate... certificates) throws java.security.GeneralSecurityException
keyPair
- the KeyPairalias
- the aliascertificates
- the certificate chainjava.security.GeneralSecurityException
- if there is a problem performing the operationpublic void setDifferentKeyAndKeyStorePassword(boolean differentKeyAndKeyStorePassword)
differentKeyAndKeyStorePassword
- a flag indicating whether to use a different key and keystore passwordprotected java.security.KeyStore loadKeystore(java.lang.String keyStore, java.lang.String keyStoreType, java.lang.String keyStorePassword) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
public void write(OutputStreamFactory outputStreamFactory) throws java.io.IOException, java.security.GeneralSecurityException
outputStreamFactory
- factory interface for creating output streamsjava.io.IOException
- if there is an IO problem while writingjava.security.GeneralSecurityException
- if there is a security problem while writingprotected PasswordUtil getPasswordUtil()
public void addConfigurationWriter(ConfigurationWriter<TlsConfig> configurationWriter)
configurationWriter
- a ConfigurationWriter which will have an opportunity to write configuration informationprotected TlsConfig getTlsConfig()