Object Jwt

  • All Implemented Interfaces:

    
    public class Jwt
    
                        

    Json Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. Spec: https://datatracker.ietf.org/doc/html/rfc7519

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Jwt INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final DecodedJwt decode(String jwt) Decode a JWT into its parts.
      final String sign(BearerDid did, JwtClaimsSet payload) Sign a JwtClaimsSet using a Bearer DID.
      final DecodedJwt verify(String jwt) Verify a JWT.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • decode

         final DecodedJwt decode(String jwt)

        Decode a JWT into its parts.

        Parameters:
        jwt - The JWT string to decode
        Returns:

        DecodedJwt

      • sign

         final String sign(BearerDid did, JwtClaimsSet payload)

        Sign a JwtClaimsSet using a Bearer DID.

        Parameters:
        did - The Bearer DID to sign with
        payload - The JwtClaimsSet payload to sign
        Returns:

        The signed JWT

      • verify

         final DecodedJwt verify(String jwt)

        Verify a JWT.

        Parameters:
        jwt - The JWT to verify
        Returns:

        DecodedJwt