|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.oauth2.sdk.auth.Secret
public class Secret
Secret or password. The secret should be erased
when no
longer in use.
Constructor Summary | |
---|---|
Secret()
Creates a new secret with a randomly generated value. |
|
Secret(byte[] value)
Creates a new secret with the specified value. |
|
Secret(byte[] value,
Date expDate)
Creates a new secret with the specified value and expiration date. |
|
Secret(int length)
Creates a new secret with a randomly generated value of the specified length. |
|
Secret(String value)
Creates a new secret with the specified value. |
|
Secret(String value,
Date expDate)
Creates a new secret with the specified value and expiration date. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Overrides Object.equals() . |
void |
erase()
Erases of the value of this secret. |
boolean |
expired()
Checks is this secret has expired. |
Date |
getExpirationDate()
Gets the expiration date of this secret. |
String |
getValue()
Gets the value of this secret. |
byte[] |
getValueBytes()
Gets the value of this secret. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Secret(String value)
value
- The value. Must not be null
or empty string.public Secret(byte[] value)
value
- The value. Must not be null
or empty array.public Secret(String value, Date expDate)
value
- The value. Must be UTF-8 encoded, not null
or
* empty string.expDate
- The expiration date, null
if not specified.public Secret(byte[] value, Date expDate)
value
- The value. Must not be null
or empty string.expDate
- The expiration date, null
if not specified.public Secret(int length)
length
- The number of characters. Must be a positive integer.public Secret()
Method Detail |
---|
public String getValue()
null
if it has
been erased.public byte[] getValueBytes()
null
if it has
been erased.public void erase()
public Date getExpirationDate()
null
if not specified.public boolean expired()
true
if the secret has an associated expiration date
which is in the past (according to the current system time),
else returns false
.public boolean equals(Object object)
Object.equals()
.
equals
in class Object
object
- The object to compare to.
true
if the objects are secrets the same value,
otherwise false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |