public final class Jwts extends Object
Standard Algorithm References
Standard JSON Web Token algorithms used during JWS or JWE building or parsing are available organized by algorithm type. Each organized collection of algorithms is available via a constant to allow for easy code-completion in IDEs, showing available algorithm instances. For example, when typing:
Jwts.// press code-completion hotkeys to suggest available algorithm registry fields Jwts.SIG.// press hotkeys to suggest individual Digital Signature or MAC algorithms or utility methods Jwts.ENC.// press hotkeys to suggest individual encryption algorithms or utility methods Jwts.KEY.// press hotkeys to suggest individual key algorithms or utility methods
| Modifier and Type | Class and Description |
|---|---|
static class |
Jwts.ENC
Constants for all standard JWA
Cryptographic Algorithms for Content
Encryption defined in the JSON
Web Signature and Encryption Algorithms Registry.
|
static interface |
Jwts.HeaderBuilder
|
static class |
Jwts.KEY
Constants for all standard JWA (RFC 7518)
Cryptographic Algorithms for Key Management.
|
static class |
Jwts.SIG
Constants for all JWA (RFC 7518) standard
Cryptographic Algorithms for Digital Signatures and MACs defined in the
JSON Web Signature and Encryption Algorithms
Registry.
|
static class |
Jwts.ZIP
Constants for JWA (RFC 7518) compression algorithms referenced in the
zip header defined in the
JSON Web Encryption Compression Algorithms
Registry. |
| Modifier and Type | Method and Description |
|---|---|
static JwtBuilder |
builder()
Returns a new
JwtBuilder instance that can be configured and then used to create JWT compact serialized
strings. |
static ClaimsBuilder |
claims()
Returns a new
Claims builder instance to be used to populate JWT claims, which in aggregate will be
the JWT payload. |
static Claims |
claims(Map<String,Object> claims)
Deprecated.
|
static Jwts.HeaderBuilder |
header()
Returns a new
Jwts.HeaderBuilder that can build any type of Header instance depending on
which builder properties are set. |
static JwtParserBuilder |
parser()
Returns a new
JwtParserBuilder instance that can be configured to create an immutable/thread-safe JwtParser. |
public static Jwts.HeaderBuilder header()
Jwts.HeaderBuilder that can build any type of Header instance depending on
which builder properties are set.Jwts.HeaderBuilder that can build any type of Header instance depending on
which builder properties are set.public static ClaimsBuilder claims()
Claims builder instance to be used to populate JWT claims, which in aggregate will be
the JWT payload.Claims builder instance to be used to populate JWT claims, which in aggregate will be
the JWT payload.@Deprecated public static Claims claims(Map<String,Object> claims)
Jwts.claims().putAll(map).build().
This method will be removed before 1.0.Deprecated since 0.12.0 in favor of
Jwts.claims().add(map).build().
This method will be removed before 1.0.
Returns a new Claims instance populated with the specified name/value pairs.
claims - the name/value pairs to populate the new Claims instance.Claims instance populated with the specified name/value pairs.public static JwtBuilder builder()
JwtBuilder instance that can be configured and then used to create JWT compact serialized
strings.JwtBuilder instance that can be configured and then used to create JWT compact serialized
strings.public static JwtParserBuilder parser()
JwtParserBuilder instance that can be configured to create an immutable/thread-safe JwtParser.Copyright © 2014–2024 jsonwebtoken.io. All rights reserved.