|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.beans.factory.config.AbstractFactoryBean
org.apache.mina.integration.spring.ssl.SSLContextFactoryBean
public class SSLContextFactoryBean
Spring FactoryBean implementation
which makes it possible to configure SSLContext
instances using Spring.
If no properties are set the returned SSLContext will
be equivalent to what the following creates:
SSLContext c = SSLContext.getInstance( "TLS" );
c.init( null, null, null );
Use the properties prefixed with keyManagerFactory to control
the creation of the KeyManager to be used.
Use the properties prefixed with trustManagerFactory to control
the creation of the TrustManagerFactory to be used.
| Field Summary |
|---|
| Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
|---|
logger |
| Constructor Summary | |
|---|---|
SSLContextFactoryBean()
|
|
| Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
|---|
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanFactory, setSingleton |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SSLContextFactoryBean()
| Method Detail |
|---|
protected Object createInstance()
throws Exception
createInstance in class AbstractFactoryBeanExceptionpublic Class getObjectType()
getObjectType in interface FactoryBeangetObjectType in class AbstractFactoryBeanpublic void setProtocol(String protocol)
SSLContext. The
default is TLS.
protocol - the name of the protocol.
IllegalArgumentException - if the specified value is
null.public void setKeyManagerFactoryAlgorithmUseDefault(boolean useDefault)
true while no KeyManagerFactory
has been set using setKeyManagerFactory(KeyManagerFactory) and
no algorithm has been set using
setKeyManagerFactoryAlgorithm(String) the default algorithm
return by KeyManagerFactory.getDefaultAlgorithm() will be used.
useDefault - true or false.public void setTrustManagerFactoryAlgorithmUseDefault(boolean useDefault)
true while no TrustManagerFactory
has been set using setTrustManagerFactory(TrustManagerFactory) and
no algorithm has been set using
setTrustManagerFactoryAlgorithm(String) the default algorithm
return by TrustManagerFactory.getDefaultAlgorithm() will be used.
useDefault - true or false.public void setKeyManagerFactory(KeyManagerFactory factory)
KeyManagerFactory to use. If this is set the properties
which are used by this factory bean to create a KeyManagerFactory
will all be ignored.
factory - the factory.public void setKeyManagerFactoryAlgorithm(String algorithm)
KeyManagerFactory
using KeyManagerFactory.getInstance(java.lang.String) or
KeyManagerFactory.getInstance(java.lang.String, java.lang.String).
This property will be ignored if a KeyManagerFactory has been
set directly using setKeyManagerFactory(KeyManagerFactory).
If this property isn't set while no KeyManagerFactory has been
set using setKeyManagerFactory(KeyManagerFactory) and
setKeyManagerFactoryAlgorithmUseDefault(boolean) has been set to
true the value returned
by KeyManagerFactory.getDefaultAlgorithm() will be used instead.
algorithm - the algorithm to use.public void setKeyManagerFactoryProvider(String provider)
KeyManagerFactory
using
KeyManagerFactory.getInstance(java.lang.String, java.lang.String).
This property will be ignored if a KeyManagerFactory has been
set directly using setKeyManagerFactory(KeyManagerFactory).
If this property isn't set and no KeyManagerFactory has been set
using setKeyManagerFactory(KeyManagerFactory)
KeyManagerFactory.getInstance(java.lang.String) will be used
to create the KeyManagerFactory.
provider - the name of the provider.public void setKeyManagerFactoryKeyStore(KeyStore keyStore)
KeyStore which will be used in the call to
KeyManagerFactory.init(java.security.KeyStore, char[]) when
the SSLContext is created.
keyStore - the key store.public void setKeyManagerFactoryKeyStorePassword(String password)
KeyManagerFactory.init(java.security.KeyStore, char[]) when
the SSLContext is created.
password - the password. Use null to disable password.public void setTrustManagerFactory(TrustManagerFactory factory)
TrustManagerFactory to use. If this is set the properties
which are used by this factory bean to create a TrustManagerFactory
will all be ignored.
factory - the factory.public void setTrustManagerFactoryAlgorithm(String algorithm)
TrustManagerFactory
using TrustManagerFactory.getInstance(java.lang.String) or
TrustManagerFactory.getInstance(java.lang.String, java.lang.String).
This property will be ignored if a TrustManagerFactory has been
set directly using setTrustManagerFactory(TrustManagerFactory).
If this property isn't set while no TrustManagerFactory has been
set using setTrustManagerFactory(TrustManagerFactory) and
setTrustManagerFactoryAlgorithmUseDefault(boolean) has been set to
true the value returned
by TrustManagerFactory.getDefaultAlgorithm() will be used instead.
algorithm - the algorithm to use.public void setTrustManagerFactoryKeyStore(KeyStore keyStore)
KeyStore which will be used in the call to
TrustManagerFactory.init(java.security.KeyStore) when
the SSLContext is created.
This property will be ignored if ManagerFactoryParameters has been
set directly using setTrustManagerFactoryParameters(ManagerFactoryParameters).
keyStore - the key store.public void setTrustManagerFactoryParameters(ManagerFactoryParameters parameters)
ManagerFactoryParameters which will be used in the call to
TrustManagerFactory.init(javax.net.ssl.ManagerFactoryParameters) when
the SSLContext is created.
parameters - describing provider-specific trust material.public void setTrustManagerFactoryProvider(String provider)
TrustManagerFactory
using
TrustManagerFactory.getInstance(java.lang.String, java.lang.String).
This property will be ignored if a TrustManagerFactory has been
set directly using setTrustManagerFactory(TrustManagerFactory).
If this property isn't set and no TrustManagerFactory has been set
using setTrustManagerFactory(TrustManagerFactory)
TrustManagerFactory.getInstance(java.lang.String) will be used
to create the TrustManagerFactory.
provider - the name of the provider.public void setSecureRandom(SecureRandom secureRandom)
SecureRandom to use when initializing the
SSLContext. The JVM's default will be used if this isn't set.
secureRandom - the SecureRandom or null if the
JVM's default should be used.SSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||