public class JWTSigner extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JWTSigner.Options
An option object for JWT signing operation.
|
| Modifier and Type | Field and Description |
|---|---|
protected static Algorithm |
DEFAULT_ALGORITHM |
| Constructor and Description |
|---|
JWTSigner(byte[] secret) |
JWTSigner(PrivateKey privateKey) |
JWTSigner(String secret) |
| Modifier and Type | Method and Description |
|---|---|
String |
sign(Map<String,Object> claims)
Generate a JSON Web Token using the default algorithm HMAC SHA-256 ("HS256")
and no claims automatically set.
|
String |
sign(Map<String,Object> claims,
JWTSigner.Options options)
Generate a JSON Web Token.
|
protected static final Algorithm DEFAULT_ALGORITHM
public JWTSigner(String secret)
public JWTSigner(byte[] secret)
public JWTSigner(PrivateKey privateKey)
public String sign(Map<String,Object> claims, JWTSigner.Options options)
claims - A map of the JWT claims that form the payload. Registered claims
must be of appropriate Java datatype as following:
options - Allow choosing the signing algorithm, and automatic setting of some registered claims.Copyright © 2016. All Rights Reserved.