public class HttpManagerServlet
extends jakarta.servlet.http.HttpServlet
HttpManagerServlet class is a servlet that acts
as a proxy for client requests to an Entrust PKI, allowing users to
be initialized through an http tunnel.
To use this class:
ManagerServlet (or any
other name you choose) using the following code
import com.entrust.toolkit.util.HttpManagerServlet;
public class ManagerServlet extends com.entrust.toolkit.util.HttpManagerServlet {
}
ManagerServlet into your Web server's
servlet folder. The specific location depends
on the Web server you are using.
The HttpManagerServlet class receives the IP address
and port number of an Entrust PKI as parameters called
managerIP and managerPort. Configure this
servlet using these paramenters. Specific configuration details
depend on the Web server you are using. For example, the
servletrunner program that is part of Sun's J2SDK, uses a
servlet.properties file to pass configuration parameters
to each servlet. A sample servlet.properties file
for ManagerServlet contains the following information:
# Manager servlet
servlet.mainManager.code=ManagerServlet
servlet.mainManager.initArgs=\
managerIP=47.97.235.29,\
managerPort=829,\
maximumLifetime=3600,\
debug=false
If you want to use this example, edit it to reflect the name and URL you choose for your servlet.
If you have several PKI's, you can re-use this HttpManagerServlet
class. Wrap it in a second ManagerServlet class as above, but
give it a new name. For example, the following servlet acts as a proxy
for PKIX-CMP messages to port number 829.
# Manager servlet
servlet.backupManager.code=ManagerServletTwo
servlet.backupManager.initArgs=\
managerIP=47.97.235.30,\
managerPort=829,\
maximumLifetime=3600,\
debug=false
Using the names in the example, the HttpManagerClient
communicates with each HttpManagerServlet as follows:
ManagerTransport main = new HttpManagerClient("http://wothdmontg.entrust.com:80/servlet/mainManager", 0, "47.97.235.29");
ManagerTransport backup = new HttpManagerClient("http://wothdmontg.entrust.com:80/servlet/backupManager", 0, "47.97.235.30");
The Web server is using port number 80 on wothdmontg.entrust.com, and
the class files, ManagerServlet and ManagerServletTwo,
are located in the server's servlet folder.
The value of the maximumLifetime property represents the
maximum allowed time interval in seconds between client messages. The
default value is is one hour.
HttpManagerClient constructor takes the
PKI Manager's IP address as a parameter even though it's messages
to the PKI are sent through a proxy. The managerIP
parameter is required by the PKIX protocol itself, so the
ManagerTransport superclass requires that address.
If the address supplied by the application does not match the IP
address of the PKI Manager, the PKIX protocol will fail. Ideally,
the address should be specified in numeric IP address 'dot' format,
47.97.235.29 for example, but if supplied as a symbolic name,
the constructor will attempt to resolve it using a DNS lookup.
HttpManagerClient,
Serialized Form| Constructor and Description |
|---|
HttpManagerServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
doGet(jakarta.servlet.http.HttpServletRequest req,
jakarta.servlet.http.HttpServletResponse res)
Call the
doGet() method in HttpManagerServletEngine class. |
void |
doPost(jakarta.servlet.http.HttpServletRequest req,
jakarta.servlet.http.HttpServletResponse res)
Call the
doPost() method in HttpManagerServletEngine class. |
java.lang.String |
getServletInfo()
Returns a short description of this servlet.
|
void |
init(jakarta.servlet.ServletConfig config)
Overrides the
init method in the servlet superclass. |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic void init(jakarta.servlet.ServletConfig config)
throws jakarta.servlet.ServletException
init method in the servlet superclass.
Initializes the servlet by attempting a connection to the Registration Authority server and throws an exception if the connection cannot be established.
init in interface jakarta.servlet.Servletinit in class jakarta.servlet.GenericServletconfig - jakarta.servlet.ServletExceptionpublic java.lang.String getServletInfo()
getServletInfo in interface jakarta.servlet.ServletgetServletInfo in class jakarta.servlet.GenericServletpublic void doPost(jakarta.servlet.http.HttpServletRequest req,
jakarta.servlet.http.HttpServletResponse res)
throws jakarta.servlet.ServletException,
java.io.IOException
Call the doPost() method in HttpManagerServletEngine class.
doPost in class jakarta.servlet.http.HttpServletreq - res - jakarta.servlet.ServletExceptionjava.io.IOExceptionHttpManagerServletEngine.doPost(HttpServletRequest, HttpServletResponse),
doGet(HttpServletRequest req, HttpServletResponse res)public void doGet(jakarta.servlet.http.HttpServletRequest req,
jakarta.servlet.http.HttpServletResponse res)
throws jakarta.servlet.ServletException,
java.io.IOException
Call the doGet() method in HttpManagerServletEngine class.
doGet in class jakarta.servlet.http.HttpServletreq - res - jakarta.servlet.ServletExceptionjava.io.IOExceptionHttpManagerServletEngine.doGet(HttpServletRequest, HttpServletResponse)