public class SMProxyManagerTransport extends ManagerTransport
ManagerTransportDEFAULT_CONNECT_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SO_TIMEOUT, in, out, recipientAddress| Constructor and Description |
|---|
SMProxyManagerTransport(IniFile entrustIniFile)
Creates a
SMProxyManagerTransport object using an entrust.ini file. |
SMProxyManagerTransport(java.lang.String smproxyHost,
int smproxyPort)
Creates a
SMProxyManagerTransport object with the Security Manager
Proxy address, as a String, and the port number (as an integer). |
SMProxyManagerTransport(java.lang.String smproxyHost,
int smproxyPort,
SMProxyConfig httpsConfig)
Creates a
SMProxyManagerTransport object with the Security Manager
Proxy address, as a String, and the port number (as an integer). |
SMProxyManagerTransport(java.net.URL smproxyURL)
Creates a
SMProxyManagerTransport object using the URL |
| Modifier and Type | Method and Description |
|---|---|
void |
beginNewSession()
Called whenever a new session or request to the PKI RA is about to be
made.
|
void |
dataReady(byte[] data)
Passes messages as a byte array.
|
void |
endSession()
Must be called whenever a session to the PKI RA is complete.
|
java.lang.String |
getAddress()
Returns the PKI RA's address specified by
managerIP in
other methods if it has not been explicitly defined. |
java.security.cert.X509Certificate[] |
getClientCredentials()
Returns the client X509Certificate chain set by
setClientCredentials. |
SMProxyConfig |
getSMProxyConfig()
Returns the Security Manager Proxy configuration.
|
boolean |
isAvailable()
Determines whether or not the PKI Registration Authority is available.
|
void |
setClientCredentials(java.security.cert.X509Certificate[] chain,
java.security.PrivateKey signingKey)
Sets the client credentials for authenticating to the Security Manager Proxy Server.
|
void |
setSMProxyConfig(SMProxyConfig config)
Sets the configuration for SSL connections
|
calculateASNLength, checkStatus, DNSLookup, getGeneralMessageInfo, getInputStream, getInstance, getInstance, getOutputStream, getPort, getSoConnectTimeout, getSoLinger, getSoTimeout, getTrustRoots, periodicPoll, readManagerTransportMessage, readNegPollRep, readPKIX4Response, readPKIXCMPResponse, setClientCredentials, setSoConnectTimeout, setSoLinger, setSoTimeout, setStreams, setTrustRootspublic SMProxyManagerTransport(IniFile entrustIniFile) throws SMProxyException, java.net.MalformedURLException
SMProxyManagerTransport object using an entrust.ini file.
This constructor takes an IniFile that contains the proxy URL addresses
with a protocol value of either http or https.
i.e http://www.proxy.entrust.com or https://www.proxy.entrust.com
If the Security Manager Proxy was not configured to use default ports, the port values must be specified in the URL. ie. http://www.proxy.entrust.com:8080 or https://www.proxy.entrust.com:4443
The Entrust Settings section of the INI file must contain one of the following settings:
entrustIniFile - the IniFile object that contains the proxy settingsSMProxyExceptionjava.net.MalformedURLExceptionSMProxyDirectory.SMProxyDirectory(IniFile entrustIniFile),
RoamingConfiguration.RoamingConfiguration(IniFile iniFile, boolean smProxyEnabled )public SMProxyManagerTransport(java.net.URL smproxyURL)
throws SMProxyException
SMProxyManagerTransport object using the URL
This constructor takes a URL constructed with a protocol value of either http or https.
i.e http://www.proxy.entrust.com or https://www.proxy.entrust.com
If the Security Manager Proxy was configured to use non-default ports, these should be specified in the URL. ie. http://www.proxy.entrust.com:8080 or https://www.proxy.entrust.com:4443
Note: If an https address is used, an SMProxyConfig object should
be used to provide the TrustManager.
smproxyURL - a URL that represents the Security Manager Proxy resourceSMProxyException - if smproxyURL is invalidpublic SMProxyManagerTransport(java.lang.String smproxyHost,
int smproxyPort)
throws SMProxyException
SMProxyManagerTransport object with the Security Manager
Proxy address, as a String, and the port number (as an integer).
Connections created with this constructor will not use SSL/TLS
smproxyHost - the Security Manager Proxy host namesmproxyPort - the Security Manager Proxy port number (typically, 80)SMProxyException - if smproxyHost value is invalidpublic SMProxyManagerTransport(java.lang.String smproxyHost,
int smproxyPort,
SMProxyConfig httpsConfig)
throws java.io.IOException
SMProxyManagerTransport object with the Security Manager
Proxy address, as a String, and the port number (as an integer).
This constructor allows the use of SSL/TLS to protect communication with the Security Manager Proxy server.
smproxyHost - the Security Manager Proxy host namesmproxyPort - the Security Manager Proxy port number (typically, 80 or 443)httpsConfig - https configuration to use when connecting to the proxy via SSL/TLS.
May be null if SSL/TLS is not required.java.io.IOException - if any of the parameters are invalidpublic void endSession()
ManagerTransport
endSession() closes the existing socket connection.
If a sub-class of ManagerTransport is created, override this
method and the dataReady() method. Reset the connection to
the RA.
endSession in class ManagerTransportpublic void dataReady(byte[] data)
throws java.io.IOException
ManagerTransport
dataReady(byte[] data) is called when a data message is ready
for the PKI RA. Sub-classes of ManagerTransport can overide
this method and send the data using any method they choose, e-mail or HTTP,
for example. The sub-classes must first have implemented a simliar proxy
mechanism on the PKI RA's side of the connection.
A User object composes a message for the PKI RA and calls
this method, passing the message in a byte array. Usually, a sub-class of
ManagerTransport implements the dataReady() method
and sends the message to the PKI RA. User then calls the
readPKIXCMPResponse() method and expects to receive a byte array containing
the RA's response.
For example, this code fragment illustrates User using
ManagerTransport:
transport.dataReady(messageForManager);
byte[] messageFromManager = transport.read();
dataReady in class ManagerTransportdata - the data that is ready to be sent to the RAjava.io.IOException - thrown if the output stream has been closed before this method
is calledManagerTransport.beginNewSession()public void beginNewSession()
ManagerTransport
beginNewSession() closes the existing socket connection, if
there is one, and connects to the PKI RA again to prepare for the
communication request.
If a sub-class of ManagerTransport is created, override this
method and the dataReady() method. Reset the connection to
the RA.
beginNewSession in class ManagerTransportpublic java.lang.String getAddress()
ManagerTransportmanagerIP in
other methods if it has not been explicitly defined.getAddress in class ManagerTransportwww.acme.com,
pkix@acme.com)public void setClientCredentials(java.security.cert.X509Certificate[] chain,
java.security.PrivateKey signingKey)
If the signingKey parameter is null, TLS client authentication will be disabled. This is the preferred configuration as a signingKey is typically not available for user create and recover operations.
setClientCredentials in class ManagerTransportchain - users certificate chainsigningKey - users private signing key or nullpublic java.security.cert.X509Certificate[] getClientCredentials()
setClientCredentials.getClientCredentials in class ManagerTransportpublic boolean isAvailable()
Note: When using TLS to protect the connection to the SMProxy server, and the TLS session has not yet been established, this method will only test the socket connection to the SMProxy server.
isAvailable in class ManagerTransportpublic SMProxyConfig getSMProxyConfig()
public void setSMProxyConfig(SMProxyConfig config)
config - the configuration to set