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:
  • Method Summary

    Modifier and Type
    Method
    Description
    Builds the JWT into a String by following the steps specified in the relevant specification according to whether the JWT is being signed and/or encrypted.
    Create a copy of the current JWT.
    Gets the claims set object for the Jwt, which contains all of the claims (name value pairs) conveyed by the JWT.
    Gets the header object for the JWT, which contains properties which describe the cryptographic operations applied to the JWT, among other properties.
  • Method Details

    • 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 a String 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:
    • copy

      Jwt copy()
      Create a copy of the current JWT.
      Returns:
      a copy of the JWT.