@Immutable public final class Nonce extends Identifier
Example generation of a nonce with eight random mixed-case alphanumeric characters:
Nonce nonce = new Nonce(8);
Related specifications:
DEFAULT_BYTE_LENGTH| Constructor and Description |
|---|
Nonce()
Creates a new nonce with a randomly generated 256-bit (32-byte)
value, Base64URL-encoded.
|
Nonce(int byteLength)
Creates a new nonce with a randomly generated value of the specified
byte length, Base64URL-encoded.
|
Nonce(java.lang.String value)
Creates a new nonce with the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
static Nonce |
parse(java.lang.String s)
Parses a nonce from the specified string.
|
compareTo, getValue, hashCode, toJSONString, toStringpublic Nonce(java.lang.String value)
value - The nonce value. Must not be null or empty
string.public Nonce(int byteLength)
byteLength - The byte length of the value to generate. Must be
greater than one.public Nonce()
public boolean equals(java.lang.Object object)
equals in class IdentifierCopyright © 2016 Connect2id Ltd.. All Rights Reserved.