|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.kernel.security.Credential
A unit of data that contains a string value, an expiration date, and a tamper-proof validator. A Credential can be converted to and from a string. Credential objects may expire after construction. Credential objects are immutable: they cannot be changed after construction.
Field Summary | |
static char |
SEPARATOR
The character used to separate the value, expiration, and validator. |
static String |
versionId
|
Method Summary | |
static Credential |
create(String value,
long lifetimeMillis)
Constructs a new credential that expires after the given number of milliseconds. |
Date |
getExpiration()
Gets the expiration date of this credential. |
String |
getValue()
Gets the value of this credential. |
boolean |
hasExpired()
Determines whether this credential has expired. |
static Credential |
parse(String credential)
Constructs a new credential parsed from the given string. |
String |
toString()
Returns the String representation of this credential. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
public static final char SEPARATOR
Method Detail |
public String toString()
parse
method.
public String getValue()
public Date getExpiration()
public boolean hasExpired()
true
if this credential has expired,
false
otherwise.public static Credential create(String value, long lifetimeMillis) throws CredentialEncodingException
value
- the value of the credentiallifetimeMillis
- the lifetime of this credential in milliseconds
CredentialEncodingException
- if the value contains the
separator character, if the lifetime is negative, or if there is an
error creating the validator.public static Credential parse(String credential) throws CredentialParsingException, CredentialExpiredException
CredentialParsingException
- if the string does not represent
a credential or if the credential is invalid.
CredentialExpiredException
- if the parsed credential has
expired.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |