|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.signrequest.SimpleHashAuthenticator
public class SimpleHashAuthenticator
SimpleHashAuthenticator
Constructor Summary | |
---|---|
SimpleHashAuthenticator()
|
Method Summary | |
---|---|
void |
authenticateRequest(org.apache.commons.httpclient.HttpMethodBase method,
java.util.List<java.lang.String> elements)
Authenticate a request |
java.lang.String |
buildSignature(java.util.List<java.lang.String> listElements,
java.lang.String strTimestamp)
Create a signature |
boolean |
isRequestAuthenticated(javax.servlet.http.HttpServletRequest request)
Check the Authentication of a request |
protected boolean |
isValidTimestamp(java.lang.String strTimestamp)
This method checks the date of the request |
void |
setHashService(HashService service)
Sets the Hash service |
void |
setPrivateKey(java.lang.String strKey)
Sets the private key |
void |
setSignatureElements(java.util.List<java.lang.String> list)
Sets the list of signature elements |
void |
setValidityTimePeriod(long lPeriod)
Sets validity time period (in seconds) between the timestamp in the request and the server timestamp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleHashAuthenticator()
Method Detail |
---|
public void setSignatureElements(java.util.List<java.lang.String> list)
list
- The listpublic void setHashService(HashService service)
service
- The Hash servicepublic void setPrivateKey(java.lang.String strKey)
strKey
- The private keypublic void setValidityTimePeriod(long lPeriod)
lPeriod
- The validity time periodpublic boolean isRequestAuthenticated(javax.servlet.http.HttpServletRequest request)
isRequestAuthenticated
in interface RequestAuthenticator
request
- The HTTP request
public void authenticateRequest(org.apache.commons.httpclient.HttpMethodBase method, java.util.List<java.lang.String> elements)
authenticateRequest
in interface RequestAuthenticator
method
- The HTTP method to authenticateelements
- List of elements to include in the signaturepublic java.lang.String buildSignature(java.util.List<java.lang.String> listElements, java.lang.String strTimestamp)
listElements
- The list of elements that part of the hashstrTimestamp
- The timestamp
protected boolean isValidTimestamp(java.lang.String strTimestamp)
strTimestamp
- The timestamp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |