public class DigestValidator extends Object
DigestUtil
Constructor and Description |
---|
DigestValidator(String digest)
Validate the digest, assuming a maximum age of 3 minutes.
|
DigestValidator(String digest,
int maxOffsetMinutes)
Validate the digest.
|
Modifier and Type | Method and Description |
---|---|
String |
getTimestamp()
Returns the timestamp that was extracted from the digest.
|
String |
getUsername()
Returns the username that was extracted from the digest.
|
String |
getUtcOffset()
Returns the UTC offset that was extracted from the digest.
|
boolean |
validate(String sharedSecret)
Validates the digest using the given shared secret.
|
public DigestValidator(String digest)
digest
- the digest to validatepublic DigestValidator(String digest, int maxOffsetMinutes)
digest
- the digest to validatemaxOffsetMinutes
- the maximum age of the digest in minutespublic boolean validate(String sharedSecret)
sharedSecret
- the shared secrettrue
if the digest is syntactically and semantically correct, i.e. if it not exceeds the
maximum age and the hash value matches the expected one
false
otherwise
public String getUsername()
public String getTimestamp()
public String getUtcOffset()
Copyright © 2011–2017 aiticon GmbH. All rights reserved.