public class HttpCRSRequest
extends java.lang.Object
URLConnection.setContentHandlerFactory(new CRSContentHandlerFactory());
The method GET is not implemented. Therefore, a Http CRS Request read from an input stream must use the POST method.
This class should be used on the client side to send CRS Messages to a server over HTTP. The CRS Messages that will need to use this class are PKCSReq, GetCert, GetCRL, RevokeReq and GetCertInitial(Verisign Only).
| Constructor and Description |
|---|
HttpCRSRequest(CRSMessage request, java.net.URL url)
Creates a new Http CRS message.
|
HttpCRSRequest(java.io.InputStream is)
Creates a new Http CRS Request by reading an input stream.
|
| Modifier and Type | Method and Description |
|---|---|
CRSMessage |
getRequest()
Gets the CRS message of this http request.
|
CRSMessage |
getResponse()
Gets the CRSMessage from the server.
|
static CRSMessage |
getResponse(CRSMessage request, java.net.HttpURLConnection conn)
Gets the CRSMessage from the server using the given
HttpURLConnection. |
public HttpCRSRequest(CRSMessage request, java.net.URL url)
Note: If the URL has and HTTPS protocol specifier, you will need to call the URL.setURLStreamHandlerFactory method with a HttpsURLStreamHandlerFactory.
request - The request to send over http.url - The url to use to connect to the CRS server.public HttpCRSRequest(java.io.InputStream is)
throws java.io.IOException
is - The InputStream from which the HttpCRSRequest will be created.java.io.IOException - If an I/O error occurs or the input encoding is incorrect or the HTTP request headers are not acceptable.public static CRSMessage getResponse(CRSMessage request, java.net.HttpURLConnection conn) throws java.io.IOException
HttpURLConnection. This method should be used on the client side in a context where calling the method URL.setURLStreamHandlerFactory for HTTPS URLs is impractical.java.io.IOExceptionpublic CRSMessage getResponse() throws java.io.IOException
java.io.IOExceptionpublic CRSMessage getRequest()