public abstract class AbstractNonceVerifier extends Object implements NonceVerifier
Modifier and Type | Field and Description |
---|---|
protected static InternetDateFormat |
_dateFormat |
protected int |
_maxAgeSeconds |
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(Date now,
Date nonce) |
protected abstract int |
seen(Date now,
String opUrl,
String nonce)
Subclasses should implement this method and check if the nonce was seen before.
|
int |
seen(String opUrl,
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.
|
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(String opUrl, 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(Date now, String opUrl, String nonce)
now
- The timestamp used to check the max age boudary.Copyright © 2019 Sxip. All rights reserved.