org.apache.camel.util.jsse
Class SSLContextParameters

java.lang.Object
  extended by org.apache.camel.util.jsse.JsseParameters
      extended by org.apache.camel.util.jsse.BaseSSLContextParameters
          extended by org.apache.camel.util.jsse.SSLContextParameters
All Implemented Interfaces:
CamelContextAware

public class SSLContextParameters
extends BaseSSLContextParameters

Represents SSLContext configuration options used in instantiating an SSLContext instance.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.camel.util.jsse.BaseSSLContextParameters
BaseSSLContextParameters.SSLContextDecorator, BaseSSLContextParameters.SSLContextSpiDecorator, BaseSSLContextParameters.SSLServerSocketFactoryDecorator, BaseSSLContextParameters.SSLSocketFactoryDecorator
 
Field Summary
protected static String DEFAULT_SECURE_SOCKET_PROTOCOL
           
 
Fields inherited from class org.apache.camel.util.jsse.BaseSSLContextParameters
DEFAULT_CIPHER_SUITES_FILTER_EXCLUDE, DEFAULT_CIPHER_SUITES_FILTER_INCLUDE, DEFAULT_SECURE_SOCKET_PROTOCOLS_FILTER_INCLUDE
 
Constructor Summary
SSLContextParameters()
           
 
Method Summary
protected  void configureSSLContext(SSLContext context)
          Configures the actual SSLContext itself with direct setter calls.
 SSLContext createSSLContext()
          Creates an SSLContext based on the related configuration options of this instance.
 SSLContextClientParameters getClientParameters()
           
 KeyManagersParameters getKeyManagers()
           
 String getProvider()
           
 SecureRandomParameters getSecureRandom()
           
 String getSecureSocketProtocol()
           
 SSLContextServerParameters getServerParameters()
           
protected  List<org.apache.camel.util.jsse.BaseSSLContextParameters.Configurer<SSLEngine>> getSSLEngineConfigurers(SSLContext context)
          Returns the list of configurers to apply to an SSLEngine in order to fully configure it in compliance with the provided configuration options.
protected  List<org.apache.camel.util.jsse.BaseSSLContextParameters.Configurer<SSLServerSocketFactory>> getSSLServerSocketFactoryConfigurers(SSLContext context)
          Returns the list of configurers to apply to an SSLServerSocketFactory in order to fully configure it in compliance with the provided configuration options.
protected  List<org.apache.camel.util.jsse.BaseSSLContextParameters.Configurer<SSLSocketFactory>> getSSLSocketFactoryConfigurers(SSLContext context)
          Returns the list of configurers to apply to an SSLSocketFactory in order to fully configure it in compliance with the provided configuration options.
 TrustManagersParameters getTrustManagers()
           
 void setClientParameters(SSLContextClientParameters clientParameters)
          The optional configuration options to be applied purely to the client side settings of the SSLContext.
 void setKeyManagers(KeyManagersParameters keyManagers)
          Sets the optional key manager configuration for creating the KeyManagers used in constructing an SSLContext.
 void setProvider(String provider)
          Sets the optional provider identifier to use when constructing an SSLContext.
 void setSecureRandom(SecureRandomParameters secureRandom)
          Sets the optional secure random configuration options to use for constructing the SecureRandom used in the creation of an SSLContext.
 void setSecureSocketProtocol(String secureSocketProtocol)
          Sets the optional protocol for the secure sockets created by the SSLContext represented by this instance's configuration.
 void setServerParameters(SSLContextServerParameters serverParameters)
          The optional configuration options to be applied purely to the server side settings of the SSLContext.
 void setTrustManagers(TrustManagersParameters trustManagers)
          Sets the optional trust manager configuration for creating the TrustManagers used in constructing an SSLContext.
 String toString()
           
 
Methods inherited from class org.apache.camel.util.jsse.BaseSSLContextParameters
configureSessionContext, filter, filter, getAllowPassthrough, getCipherSuites, getCipherSuitesFilter, getDefaultCipherSuitesFilter, getDefaultSecureSocketProcotolFilter, getSecureSocketProtocols, getSecureSocketProtocolsFilter, getSessionTimeout, getSSLServerSocketFactorySSLServerSocketConfigurers, getSSLSocketFactorySSLSocketConfigurers, matchesOneOf, setCipherSuites, setCipherSuitesFilter, setSecureSocketProtocols, setSecureSocketProtocolsFilter, setSessionTimeout
 
Methods inherited from class org.apache.camel.util.jsse.JsseParameters
getCamelContext, parsePropertyValue, parsePropertyValues, resolveResource, setCamelContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SECURE_SOCKET_PROTOCOL

protected static final String DEFAULT_SECURE_SOCKET_PROTOCOL
See Also:
Constant Field Values
Constructor Detail

SSLContextParameters

public SSLContextParameters()
Method Detail

getKeyManagers

public KeyManagersParameters getKeyManagers()

setKeyManagers

public void setKeyManagers(KeyManagersParameters keyManagers)
Sets the optional key manager configuration for creating the KeyManagers used in constructing an SSLContext.

Parameters:
keyManagers - the options or null to provide no KeyManagers

getTrustManagers

public TrustManagersParameters getTrustManagers()

setTrustManagers

public void setTrustManagers(TrustManagersParameters trustManagers)
Sets the optional trust manager configuration for creating the TrustManagers used in constructing an SSLContext.

Parameters:
trustManagers - the options or null to provide no TrustManagers

getSecureRandom

public SecureRandomParameters getSecureRandom()

setSecureRandom

public void setSecureRandom(SecureRandomParameters secureRandom)
Sets the optional secure random configuration options to use for constructing the SecureRandom used in the creation of an SSLContext.

Parameters:
secureRandom - the options or null to use the default

getClientParameters

public SSLContextClientParameters getClientParameters()

setClientParameters

public void setClientParameters(SSLContextClientParameters clientParameters)
The optional configuration options to be applied purely to the client side settings of the SSLContext. Settings specified here override any duplicate settings provided at the overall level by this class. These parameters apply to SSLSocketFactorys and SSLEngines produced by the the SSLContext produced from this class as well as to the SSLContext itself.

Parameters:
clientParameters - the optional additional client-side parameters

getServerParameters

public SSLContextServerParameters getServerParameters()

setServerParameters

public void setServerParameters(SSLContextServerParameters serverParameters)
The optional configuration options to be applied purely to the server side settings of the SSLContext. Settings specified here override any duplicate settings provided at the overall level by this class. These parameters apply to SSLServerSocketFactorys and SSLEngines produced by the the SSLContext produced from this class as well as to the SSLContext itself.

Parameters:
serverParameters - the optional additional client-side parameters

getProvider

public String getProvider()

setProvider

public void setProvider(String provider)
Sets the optional provider identifier to use when constructing an SSLContext.

Parameters:
provider - the identifier (from the list of available providers returned by Security.getProviders()) or null to use the highest priority provider implementing the secure socket protocol
See Also:
Security.getProviders(java.util.Map), setSecureSocketProtocol(String)

getSecureSocketProtocol

public String getSecureSocketProtocol()

setSecureSocketProtocol

public void setSecureSocketProtocol(String secureSocketProtocol)
Sets the optional protocol for the secure sockets created by the SSLContext represented by this instance's configuration. Defaults to TLS. See Appendix A in the Java Secure Socket Extension Reference Guide for information about standard protocol names.

Parameters:
secureSocketProtocol - the name of the protocol or null to use the default (TLS)

createSSLContext

public SSLContext createSSLContext()
                            throws GeneralSecurityException,
                                   IOException
Creates an SSLContext based on the related configuration options of this instance. Namely, keyManagers, trustManagers, and secureRandom, but also respecting the chosen provider and secure socket protocol as well.

Returns:
a newly configured instance
Throws:
GeneralSecurityException - if there is a problem in this instances configuration or that of its nested configuration options
IOException - if there is an error reading a key/trust store

configureSSLContext

protected void configureSSLContext(SSLContext context)
                            throws GeneralSecurityException
Description copied from class: BaseSSLContextParameters
Configures the actual SSLContext itself with direct setter calls. This method differs from configuration options that are handled by a configurer instance in that the options are part of the context itself and are not part of some factory or instance object returned by the context.

Overrides:
configureSSLContext in class BaseSSLContextParameters
Parameters:
context - the context to configure
Throws:
GeneralSecurityException - if there is an error configuring the context

getSSLEngineConfigurers

protected List<org.apache.camel.util.jsse.BaseSSLContextParameters.Configurer<SSLEngine>> getSSLEngineConfigurers(SSLContext context)
Description copied from class: BaseSSLContextParameters
Returns the list of configurers to apply to an SSLEngine in order to fully configure it in compliance with the provided configuration options. The configurers are to be applied in the order in which they appear in the list.

Overrides:
getSSLEngineConfigurers in class BaseSSLContextParameters
Parameters:
context - the context that serves as the factory for SSLEngine instances
Returns:
the needed configurers

getSSLSocketFactoryConfigurers

protected List<org.apache.camel.util.jsse.BaseSSLContextParameters.Configurer<SSLSocketFactory>> getSSLSocketFactoryConfigurers(SSLContext context)
Description copied from class: BaseSSLContextParameters
Returns the list of configurers to apply to an SSLSocketFactory in order to fully configure it in compliance with the provided configuration options. The configurers are to be applied in the order in which they appear in the list.

It is preferred to use BaseSSLContextParameters.getSSLSocketFactorySSLSocketConfigurers(SSLContext) instead of this method as SSLSocketFactory does not contain any configuration options that are non-proprietary.

Overrides:
getSSLSocketFactoryConfigurers in class BaseSSLContextParameters
Parameters:
context - the context that serves as the factory for SSLSocketFactory instances
Returns:
the needed configurers
See Also:
BaseSSLContextParameters.getSSLSocketFactorySSLSocketConfigurers(SSLContext)

getSSLServerSocketFactoryConfigurers

protected List<org.apache.camel.util.jsse.BaseSSLContextParameters.Configurer<SSLServerSocketFactory>> getSSLServerSocketFactoryConfigurers(SSLContext context)
Description copied from class: BaseSSLContextParameters
Returns the list of configurers to apply to an SSLServerSocketFactory in order to fully configure it in compliance with the provided configuration options. The configurers are to be applied in the order in which they appear in the list.

It is preferred to use BaseSSLContextParameters.getSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext) instead of this method as SSLServerSocketFactory does not contain any configuration options that are non-proprietary.

Overrides:
getSSLServerSocketFactoryConfigurers in class BaseSSLContextParameters
Parameters:
context - the context that serves as the factory for SSLServerSocketFactory instances
Returns:
the needed configurers
See Also:
BaseSSLContextParameters.getSSLServerSocketFactorySSLServerSocketConfigurers(SSLContext)

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL