fr.paris.lutece.util.signrequest
Class AbstractAuthenticator

java.lang.Object
  extended by fr.paris.lutece.util.signrequest.AbstractAuthenticator
All Implemented Interfaces:
RequestAuthenticator
Direct Known Subclasses:
HeaderHashAuthenticator, RequestHashAuthenticator

public abstract class AbstractAuthenticator
extends java.lang.Object
implements RequestAuthenticator

AbstractAuthenticator


Field Summary
protected static org.apache.log4j.Logger _logger
           
 
Constructor Summary
AbstractAuthenticator()
           
 
Method Summary
 java.lang.String buildSignature(java.util.List<java.lang.String> listElements, java.lang.String strTimestamp)
          Create a signature
protected  java.util.List<java.lang.String> getSignatureElements()
          Returns the list of signature elements
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
 
Methods inherited from interface fr.paris.lutece.util.signrequest.RequestAuthenticator
authenticateRequest, isRequestAuthenticated
 

Field Detail

_logger

protected static org.apache.log4j.Logger _logger
Constructor Detail

AbstractAuthenticator

public AbstractAuthenticator()
Method Detail

setSignatureElements

public void setSignatureElements(java.util.List<java.lang.String> list)
Sets the list of signature elements

Parameters:
list - The list

getSignatureElements

protected java.util.List<java.lang.String> getSignatureElements()
Returns the list of signature elements

Returns:
The list of elements

setHashService

public void setHashService(HashService service)
Sets the Hash service

Parameters:
service - The Hash service

setPrivateKey

public void setPrivateKey(java.lang.String strKey)
Sets the private key

Parameters:
strKey - The private key

setValidityTimePeriod

public void setValidityTimePeriod(long lPeriod)
Sets validity time period (in seconds) between the timestamp in the request and the server timestamp

Parameters:
lPeriod - The validity time period

buildSignature

public java.lang.String buildSignature(java.util.List<java.lang.String> listElements,
                                       java.lang.String strTimestamp)
Create a signature

Parameters:
listElements - The list of elements that part of the hash
strTimestamp - The timestamp
Returns:
A signature as an Hexadecimal Hash

isValidTimestamp

protected boolean isValidTimestamp(java.lang.String strTimestamp)
This method checks the date of the request

Parameters:
strTimestamp - The timestamp
Returns:
true if the timestamp is valid, otherwise false


Copyright © 2011 Mairie de Paris. All Rights Reserved.