|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.cornerstone.blocks.sockets.SSLFactoryBuilder
public class SSLFactoryBuilder
Builds SSLContexts with desired properties. Hides all the gory details of SSLContext productions behind nice Avalon interfaces. Married to Sun JCA implementation.
Configuration looks like:
<ssl-factory> <keystore> <file>conf/keystore</file> <!-- keystore file location --> <password></password> <!-- Key Store file password, only used to check keystore integrity --> <key-password></key-password> <!-- Only required when you need to decrypt a private key --> <type>JKS</type> <!-- Key Store file format, defaults to JKS --> <algorithm>SunX509</algorithm> <!-- Cryptography provider ID, defaults to SunX509 --> </keystore> <!-- SSL protocol to use, defaults to TLS, another possible value is SSL --> <protocol>TLS</protocol> </ssl-factory>
Notes on keystore files. Absolute paths are supported. Relative paths are interpreted relative to .sar base directory. Defaults to conf/keystore. Since keystore usually contains sensitive keys it maybe beneficial to not include the keystores into the .sar files.
Constructor Summary | |
---|---|
SSLFactoryBuilder()
|
Method Summary | |
---|---|
javax.net.ssl.SSLServerSocketFactory |
buildServerSocketFactory()
Produces a fresh ssl server socket factory with configured parameters. |
javax.net.ssl.SSLSocketFactory |
buildSocketFactory()
Produces a fresh ssl socket factory with configured parameters. |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
contextualize(org.apache.avalon.framework.context.Context context)
Requires a BlockContext. |
void |
dispose()
|
void |
initialize()
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SSLFactoryBuilder()
Method Detail |
---|
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
org.apache.avalon.framework.context.ContextException
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
public javax.net.ssl.SSLSocketFactory buildSocketFactory()
public javax.net.ssl.SSLServerSocketFactory buildServerSocketFactory()
public void initialize() throws java.io.IOException, java.security.GeneralSecurityException
initialize
in interface org.apache.avalon.framework.activity.Initializable
java.io.IOException
java.security.GeneralSecurityException
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |