public class SMProxyConfig extends java.lang.Object implements LogoutListener
JSSEX509TrustManager for the SMProxySSLSocketFactory.
Note:The certificates are stored in a static memory cache. This means every certificate added or removed through this class will be added/removed for every subsequent HTTPS connection made with a SMProxy related class instance.
User object can be supplied.
Example usage. Implicit SMProxy configuration via INI:
User user = new User(); user.setConnections(inifile); . . user.login(CredentialReader,SecureStringBuffer);Explicit SMProxy configuration - Directory only:
User user = new User();
SMProxyConfig config = new SMProxyConfig(user);
SMProxyDirectory directory = new SMProxyDirectory("http://proxyserver");
directory.setSMProxyConfig(config);
user.setConnections(directory, null);
.
.
user.login(CredentialReader,SecureStringBuffer);
| Constructor and Description |
|---|
SMProxyConfig()
The default constructor.
|
SMProxyConfig(boolean enabled)
Constructor which allows SSL to be enabled or disabled for this SMProxy configuration.
|
SMProxyConfig(User user)
Constructor which enables SSL and creates a keyManager and trustManager object from the provided user object.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getClientAuth()
Returns true is this Security Manager Proxy client will respond to a request for client
authentication.
|
static boolean |
getCompatMode()
Returns whether compatibility mode is enabled.
|
javax.net.ssl.KeyManager |
getKeyManager()
Returns the KeyManager
|
java.lang.String[] |
getSSLCipherSuites()
Returns the names of the SSL cipher suites that will be used for the Security Manager Proxy connection.
|
boolean |
getSSLEnabled()
Returns SSL enabled value
|
java.lang.String[] |
getSSLProtocols()
Gets the SSL protocol versions that will be used for the Security Manager Proxy connection.
|
javax.net.ssl.TrustManager |
getTrustManager()
Returns the TrustManager
|
void |
logout()
The logout callback function; called from the user when logging out.
|
static void |
setClientAuth(boolean enable)
Enables or disables client authentication for the SSL session.
|
static void |
setCompatMode(boolean enable)
Sets compatibility mode.
|
void |
setKeyManager(javax.net.ssl.KeyManager keyManger)
Sets the KeyManager to use for the SSL connection
|
void |
setSSLCipherSuites(java.lang.String[] sslCipherSuites)
Sets the SSL cipher suites that will be used for the Security Manager Proxy connection.
|
void |
setSSLEnabled(boolean SSL)
Sets whether SSL should be enabled.
|
void |
setSSLProtocols(java.lang.String[] sslProtocols)
Sets the SSL protocol versions that will be used for the Security Manager Proxy connection.
|
void |
setTrustManager(javax.net.ssl.TrustManager trustManger)
Sets the trustManager to use for the SSL connection
|
public SMProxyConfig()
public SMProxyConfig(boolean enabled)
enabled - sets whether SSL is enabled or disabled.public SMProxyConfig(User user) throws SMProxyException
Note: The user in this case would typically be offline. Also, once the user logs out the keyManager and trustManager will be cleared.
user - Entrust user that will be used to create the trustManager and keyManager.SMProxyException - if there are any other issues when attempting to obtain credentials from the
provided user.public java.lang.String[] getSSLProtocols()
public void setSSLProtocols(java.lang.String[] sslProtocols)
sslProtocols - List of all the protocols to enable.public java.lang.String[] getSSLCipherSuites()
public void setSSLCipherSuites(java.lang.String[] sslCipherSuites)
sslCipherSuites - List of all the cipher suites to enablepublic void setKeyManager(javax.net.ssl.KeyManager keyManger)
keyManger - the m_keyManager to setpublic void setTrustManager(javax.net.ssl.TrustManager trustManger)
trustManger - the trustManager to setpublic javax.net.ssl.KeyManager getKeyManager()
public javax.net.ssl.TrustManager getTrustManager()
public boolean getSSLEnabled()
public void setSSLEnabled(boolean SSL)
SSL - true indicates SSL enabled, false SSL disabledpublic void logout()
LogoutListenerlogout in interface LogoutListenerpublic static boolean getClientAuth()
public static void setClientAuth(boolean enable)
As the private key is only available in some cases, it's recommended that this setting is always set to false. User create, recover and roaming are not possible if this value is set. This sets the value of the system property 'com.entrust.toolkit.SMProxy.useClientAuth'
enable - set to true to enable client authentication. Defaults to false.public static boolean getCompatMode()
When connecting to Security Manager Proxy server 6 , this must be true. This returns the value for the system property 'com.entrust.toolkit.smproxy.compat'
public static void setCompatMode(boolean enable)
When connecting to Security Manager Proxy server 6 , this must be set to true. This sets the value for the system property 'com.entrust.toolkit.smproxy.compat'
enable - whether compatibility mode is enabled. Defaults to false.