Package org.forgerock.json.jose.jwt
Interface Jwt
-
- All Known Implementing Classes:
EncryptedJwt
,EncryptedThenSignedJwt
,SignedEncryptedJwt
,SignedJwt
,SignedThenEncryptedJwt
public interface Jwt
The interface for all types of JSON Web Tokens (JWTs).JSON Web Token (JWT) is a means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is digitally signed or MACed using JSON Web Signature (JWS) and/or encrypted using JSON Web Encryption (JWE).
- Since:
- 2.0.0
- See Also:
- JSON Web Token Specification
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
build()
Builds the JWT into aString
by following the steps specified in the relevant specification according to whether the JWT is being signed and/or encrypted.Jwt
copy()
Create a copy of the current JWT.JwtClaimsSet
getClaimsSet()
Gets the claims set object for the Jwt, which contains all of the claims (name value pairs) conveyed by the JWT.JwtHeader
getHeader()
Gets the header object for the JWT, which contains properties which describe the cryptographic operations applied to the JWT, among other properties.
-
-
-
Method Detail
-
getHeader
JwtHeader getHeader()
Gets the header object for the JWT, which contains properties which describe the cryptographic operations applied to the JWT, among other properties.When the JWT is digitally signed or MACed, the JWT Header is a JWS Header. When the JWT is encrypted, the JWT Header is a JWE Header.
- Returns:
- The JWTs Header.
-
getClaimsSet
JwtClaimsSet getClaimsSet()
Gets the claims set object for the Jwt, which contains all of the claims (name value pairs) conveyed by the JWT.- Returns:
- The JWTs Claims Set.
-
build
String build()
Builds the JWT into aString
by following the steps specified in the relevant specification according to whether the JWT is being signed and/or encrypted.- Returns:
- The base64url encoded UTF-8 parts of the JWT.
- See Also:
- JSON Web Token Specification, JSON Web Signature Specification, JSON Web Encryption Specification
-
copy
Jwt copy()
Create a copy of the current JWT.- Returns:
- a copy of the JWT.
-
-