Class BasicHeader

java.lang.Object
com.auth0.jwt.impl.BasicHeader
All Implemented Interfaces:
Header

class BasicHeader extends Object implements Header
The BasicHeader class implements the Header interface.
  • Field Details

    • algorithm

      private final String algorithm
    • type

      private final String type
    • contentType

      private final String contentType
    • keyId

      private final String keyId
    • tree

      private final Map<String,com.fasterxml.jackson.databind.JsonNode> tree
    • objectReader

      private final com.fasterxml.jackson.databind.ObjectReader objectReader
  • Constructor Details

    • BasicHeader

      BasicHeader(String algorithm, String type, String contentType, String keyId, Map<String,com.fasterxml.jackson.databind.JsonNode> tree, com.fasterxml.jackson.databind.ObjectReader objectReader)
  • Method Details

    • getTree

      Map<String,com.fasterxml.jackson.databind.JsonNode> getTree()
    • getAlgorithm

      public String getAlgorithm()
      Description copied from interface: Header
      Getter for the Algorithm "alg" claim defined in the JWT's Header. If the claim is missing it will return null.
      Specified by:
      getAlgorithm in interface Header
      Returns:
      the Algorithm defined or null.
    • getType

      public String getType()
      Description copied from interface: Header
      Getter for the Type "typ" claim defined in the JWT's Header. If the claim is missing it will return null.
      Specified by:
      getType in interface Header
      Returns:
      the Type defined or null.
    • getContentType

      public String getContentType()
      Description copied from interface: Header
      Getter for the Content Type "cty" claim defined in the JWT's Header. If the claim is missing it will return null.
      Specified by:
      getContentType in interface Header
      Returns:
      the Content Type defined or null.
    • getKeyId

      public String getKeyId()
      Description copied from interface: Header
      Get the value of the "kid" claim, or null if it's not available.
      Specified by:
      getKeyId in interface Header
      Returns:
      the Key ID value or null.
    • getHeaderClaim

      public Claim getHeaderClaim(String name)
      Description copied from interface: Header
      Get a Private Claim given it's name. If the Claim wasn't specified in the Header, a NullClaim will be returned.
      Specified by:
      getHeaderClaim in interface Header
      Parameters:
      name - the name of the Claim to retrieve.
      Returns:
      a non-null Claim.