Creating an HTTP tunnel

See below for how to connect to a PKI using a tunnel to proxy servlets.

Creating a user

Create a user object.

com.entrust.toolkit.User user = new User();

Preparing the connections

Prepare a connection to the PKI's CA key management server.

com.entrust.toolkit.util.ManagerTransport transport = new HttpManagerClient(managerServletURL, 0, managerIP);

Prepare a connection to the Directory.

com.entrust.toolkit.x509.LdapDirectory directory = new HttpDirectoryClient(directoryServletURL, 0);

Setting header information

Optionally, set HTTP header information (in this case, the authorization request field whose values are ase64-encoded).

String webId = <"ID">;
String webPassword = <"password">;
Base64Encoder encoder = new Base64Encoder( webId + ":" + webPassword );
directory.addHttpHeader( "Authorization", "Basic " + encoder.processString() );
transport.addHttpHeader( "Authorization", "Basic " + encoder.processString() );

Setting the proxy

Optionally, you can specify an authenticating proxy server.

directory.setWebProxy(<ip>, <port>);
transport.setWebProxy(<ip>, <port>);

Establishing the connection

Establish the connections to the Directory and the CA key management server.

user.setConnections(directory, transport);