|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.jndi.JNDIBaseStorable
org.apache.activemq.ActiveMQConnectionFactory
org.apache.activemq.ActiveMQSslConnectionFactory
public class ActiveMQSslConnectionFactory
An ActiveMQConnectionFactory that allows access to the key and trust managers
used for SslConnections. There is no reason to use this class unless SSL is
being used AND the key and trust managers need to be specified from within
code. In fact, if the URI passed to this class does not have an "ssl" scheme,
this class will pass all work on to its superclass.
There are two alternative approaches you can use to provide X.509
certificates for the SSL connections:
Call setTrustStore, setTrustStorePassword,
setKeyStore, and setKeyStorePassword.
Call setKeyAndTrustManagers.
| Field Summary | |
|---|---|
protected KeyManager[] |
keyManager
|
protected String |
keyStore
|
protected String |
keyStorePassword
|
protected SecureRandom |
secureRandom
|
protected TrustManager[] |
trustManager
|
protected String |
trustStore
|
protected String |
trustStorePassword
|
| Fields inherited from class org.apache.activemq.ActiveMQConnectionFactory |
|---|
alwaysSessionAsync, brokerURL, clientID, DEFAULT_BROKER_BIND_URL, DEFAULT_BROKER_URL, DEFAULT_PASSWORD, DEFAULT_PRODUCER_WINDOW_SIZE, DEFAULT_USER, dispatchAsync, password, userName, xaAckMode |
| Constructor Summary | |
|---|---|
ActiveMQSslConnectionFactory()
|
|
ActiveMQSslConnectionFactory(String brokerURL)
|
|
ActiveMQSslConnectionFactory(URI brokerURL)
|
|
| Method Summary | |
|---|---|
protected KeyManager[] |
createKeyManager()
|
protected Transport |
createTransport()
Overriding to make special considerations for SSL connections. |
protected TrustManager[] |
createTrustManager()
|
protected InputStream |
getInputStream(String urlOrResource)
|
String |
getKeyStore()
|
String |
getKeyStorePassword()
|
String |
getTrustStore()
|
String |
getTrustStorePassword()
|
protected byte[] |
loadClientCredential(String fileName)
|
void |
setKeyAndTrustManagers(KeyManager[] km,
TrustManager[] tm,
SecureRandom random)
Sets the key and trust managers used when creating SSL connections. |
void |
setKeyStore(String keyStore)
The location of a keystore file (in jks format) containing a
certificate and its private key. |
void |
setKeyStorePassword(String keyStorePassword)
The password to match the key store specified by setKeyStore. |
void |
setTrustStore(String trustStore)
The location of a keystore file (in jks format) containing
one or more trusted certificates. |
void |
setTrustStorePassword(String trustStorePassword)
The password to match the trust store specified by setTrustStore. |
| Methods inherited from class org.apache.activemq.jndi.JNDIBaseStorable |
|---|
getProperties, getReference, readExternal, setProperties, writeExternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected KeyManager[] keyManager
protected TrustManager[] trustManager
protected SecureRandom secureRandom
protected String trustStore
protected String trustStorePassword
protected String keyStore
protected String keyStorePassword
| Constructor Detail |
|---|
public ActiveMQSslConnectionFactory()
public ActiveMQSslConnectionFactory(String brokerURL)
public ActiveMQSslConnectionFactory(URI brokerURL)
| Method Detail |
|---|
public void setKeyAndTrustManagers(KeyManager[] km,
TrustManager[] tm,
SecureRandom random)
km - The KeyManagers used.tm - The TrustManagers used.random - The SecureRandom number used.
protected Transport createTransport()
throws javax.jms.JMSException
createTransport in class ActiveMQConnectionFactoryjavax.jms.JMSException - If unable to create trasnport.
protected TrustManager[] createTrustManager()
throws Exception
Exception
protected KeyManager[] createKeyManager()
throws Exception
Exception
protected byte[] loadClientCredential(String fileName)
throws IOException
IOException
protected InputStream getInputStream(String urlOrResource)
throws IOException
IOExceptionpublic String getTrustStore()
public void setTrustStore(String trustStore)
throws Exception
jks format) containing
one or more trusted certificates.
trustStore - If specified with a scheme, treat as a URL, otherwise treat as
a classpath resource.
Exceptionpublic String getTrustStorePassword()
public void setTrustStorePassword(String trustStorePassword)
setTrustStore.
trustStorePassword - The password used to unlock the keystore file.public String getKeyStore()
public void setKeyStore(String keyStore)
throws Exception
jks format) containing a
certificate and its private key.
keyStore - If specified with a scheme, treat as a URL, otherwise treat as
a classpath resource.
Exceptionpublic String getKeyStorePassword()
public void setKeyStorePassword(String keyStorePassword)
setKeyStore.
keyStorePassword - The password, which is used both to unlock the keystore file
and as the pass phrase for the private key stored in the
keystore.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||