java.lang.Object
net.i2p.i2ptunnel.I2PTunnelHTTPClientBase.NonceInfo
- Enclosing class:
I2PTunnelHTTPClientBase
Tracks nonce values for digest authentication.
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionlongWhen the nonce expires.isValid(int nc) Whether the nonce is still usable.
Field Details
expires
private final long expiresWhen the nonce record expires.counts
Bits marking the nonces already used.
Constructor Details
NonceInfo
public NonceInfo(long exp) Creates a nonce valid until the given time.- Parameters:
exp- the time in milliseconds after which the nonce is no longer accepted, as an absoluteClock.now()timestamp
Method Details
getExpires
public long getExpires()When the nonce expires.- Returns:
- the time in milliseconds after which this nonce is no longer accepted, as passed to the constructor
isValid
Whether the nonce is still usable.- Parameters:
nc- the nonce count from the request, above zero and below MAX_NONCE_COUNT- Returns:
- AUTH_GOOD when the nonce has not expired and this nonce count has not been seen before, otherwise AUTH_BAD or AUTH_STALE