org.openid4java.consumer
public abstract class AbstractNonceVerifier extends java.lang.Object implements NonceVerifier
Modifier and Type | Field and Description |
---|---|
protected static InternetDateFormat |
_dateFormat |
private static org.apache.commons.logging.Log |
_log |
protected int |
_maxAgeSeconds |
private static boolean |
DEBUG |
INVALID_TIMESTAMP, OK, SEEN, TOO_OLD
Modifier | Constructor and Description |
---|---|
protected |
AbstractNonceVerifier(int maxAge) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxAge()
Returns the expiration timeout for nonces, in seconds.
|
protected boolean |
isTooOld(java.util.Date now,
java.util.Date nonce) |
protected abstract int |
seen(java.util.Date now,
java.lang.String opUrl,
java.lang.String nonce)
Subclasses should implement this method and check if the nonce was seen before.
|
int |
seen(java.lang.String opUrl,
java.lang.String nonce)
Checks if nonce date is valid and if it is in the max age boundary.
|
void |
setMaxAge(int ageSeconds)
Sets the expiration timeout for nonces, in seconds.
|
private static org.apache.commons.logging.Log _log
private static final boolean DEBUG
protected static InternetDateFormat _dateFormat
protected int _maxAgeSeconds
protected AbstractNonceVerifier(int maxAge)
maxAge
- maximum token age in secondspublic int getMaxAge()
NonceVerifier
getMaxAge
in interface NonceVerifier
public void setMaxAge(int ageSeconds)
NonceVerifier
setMaxAge
in interface NonceVerifier
public int seen(java.lang.String opUrl, java.lang.String nonce)
seen(java.util.Date, String, String)
seen
in interface NonceVerifier
NonceVerifier.OK
only if this nonce has a valid time stamp, the time stamp did not age and the nonce was not
seen before.protected abstract int seen(java.util.Date now, java.lang.String opUrl, java.lang.String nonce)
now
- The timestamp used to check the max age boudary.protected boolean isTooOld(java.util.Date now, java.util.Date nonce)
Copyright 2006-2008 Sxip Identity Corporation