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 | 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.
|
public JWTSigner(String secret)
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 © 2014. All Rights Reserved.