|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.faceless.pdf2.RemoteSigningServlet
public class RemoteSigningServlet
This Servlet can be used in conjunction with the RemoteSignatureHandlerFactory
to remotely calculate the signature for a PDF. The API documentation for that class has
fairly high-level details on how to install and use remote signing capabilities. This
class documentation has information on customizing the installation.
As supplied, this class takes all it's setup parameters from the servlet's init-param
.
settings. The following parameters are recognised:
alias | The alias of the signing key to use in the keystore |
---|---|
password | The password required to open the signing key in the keystore. If not specified this defaults to keystore.password |
keystore.path | The path to the keystore, relative to the root of the web application. Typically the keystore would be stored in the WEB-INF folder, so this path will be something like WEB-INF/keystore.jks |
keystore.password | The password to unlock the keystore |
keystore.provider | The provider to use to create the KeyStore, eg "BC" for the Bouncy Castle package |
keystore.type | The type of keystore. Defaults to KeyStore.getDefaultType() , typical values are "JKS" or "PKCS12" |
sig.name | The "name" field to apply to the signature, representing the name of the signing entity. The client API will prevent this from being overridden by the user, but as this field is not part of the PKCS#7 object it's not possible to guarantee this won't happen (cryptographically speaking). Acrobat should display the name from the PKCS#7 object if available in place of this one |
sig.reason | The "reason" field to apply to the signature. The client API will prevent this from being overridden by the user, but as this field is not part of the PKCS#7 object it's not possible to guarantee this won't happen (cryptographically speaking) |
sig.location | The "location" field to apply to the signature. The client API will prevent this from being overridden by the user, but as this field is not part of the PKCS#7 object it's not possible to guarantee this won't happen (cryptographically speaking) |
sig.contactinfo | The "contact information" field to apply to the signature. The client API will prevent this from being overridden by the user, but as this field is not part of the PKCS#7 object it's not possible to guarantee this won't happen (cryptographically speaking) |
timestampserver | The URL of an RFC3161 TimeStamp server that should be use to timestamp the PKCS#7 object |
HttpServletRequest.getPathInfo()
and so on.
RemoteSigningServlet
,
Serialized FormConstructor Summary | |
---|---|
RemoteSigningServlet()
|
Method Summary | |
---|---|
void |
doPost(HttpServletRequest req,
HttpServletResponse res)
|
String |
getAlias(HttpServletRequest req)
Return the alias of the key in the KeyStore to use for signing. |
String |
getContactInfo(HttpServletRequest req)
Return the contact information for the entity createing the signature. |
KeyStore |
getKeyStore(HttpServletRequest req)
Return a KeyStore to load the key from. |
String |
getLocation(HttpServletRequest req)
Return the location the signature is being signed at. |
String |
getName(HttpServletRequest req)
Return the name of the entity signing the signature. |
char[] |
getPassword(HttpServletRequest req)
Return the password for the alias in the KeyStore. |
String |
getReason(HttpServletRequest req)
Return the reason the signature is being signed. |
String |
getTimeStampServer(HttpServletRequest req)
Return the server to use for RFC3161 timestamping of this signature. |
void |
init()
|
Methods inherited from class javax.servlet.http.HttpServlet |
---|
service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemoteSigningServlet()
Method Detail |
---|
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
doPost
in class HttpServlet
ServletException
IOException
public void init() throws ServletException
init
in class GenericServlet
ServletException
public String getName(HttpServletRequest req)
sig.name
init-parameter if specified.
req
- the servlet request.public String getReason(HttpServletRequest req)
sig.reason
init-parameter if specified.
req
- the servlet request.public String getLocation(HttpServletRequest req)
sig.location
init-parameter if specified.
req
- the servlet request.public String getContactInfo(HttpServletRequest req)
sig.contactinfo
init-parameter if specified.
req
- the servlet request.public KeyStore getKeyStore(HttpServletRequest req) throws ServletException, IOException, GeneralSecurityException
KeyStore
to load the key from. The default implementation of
this method returns the KeyStore created in the init()
method from the
keystore.path
, keystore.type
, keystore.provider
and keystore.password
init-parameters, but this method may be overridden
if required.
req
- the HttpServletRequest
made to this servlet.
KeyStore
containing a private key that can be used for signing.
ServletException
IOException
GeneralSecurityException
public String getAlias(HttpServletRequest req) throws ServletException
alias
init-parameter, and fails if it's not specified.
req
- the HttpServletRequest
made to this servlet.
ServletException
public char[] getPassword(HttpServletRequest req) throws ServletException
password
init-parameter if specified, or the keystore.password
init-parameter
if not. If neither are specified this method fails.
req
- the HttpServletRequest
made to this servlet.
ServletException
public String getTimeStampServer(HttpServletRequest req) throws ServletException
timestampserver
init-param if specified, or null if not.
null
to not timestamp the signature
ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |