Package com.auth0.jwt.impl
Class JWTParser
- java.lang.Object
-
- com.auth0.jwt.impl.JWTParser
-
- All Implemented Interfaces:
JWTPartsParser
public class JWTParser extends java.lang.Object implements JWTPartsParser
This class helps in decoding the Header and Payload of the JWT usingHeaderSerializer
andPayloadSerializer
.
-
-
Constructor Summary
Constructors Constructor Description JWTParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Header
parseHeader(java.lang.String json)
Parses the given JSON into aHeader
instance.Payload
parsePayload(java.lang.String json)
Parses the given JSON into aPayload
instance.
-
-
-
Method Detail
-
parsePayload
public Payload parsePayload(java.lang.String json) throws JWTDecodeException
Description copied from interface:JWTPartsParser
Parses the given JSON into aPayload
instance.- Specified by:
parsePayload
in interfaceJWTPartsParser
- Parameters:
json
- the content of the Payload in a JSON representation.- Returns:
- the Payload.
- Throws:
JWTDecodeException
- if the json doesn't have a proper JSON format.
-
parseHeader
public Header parseHeader(java.lang.String json) throws JWTDecodeException
Description copied from interface:JWTPartsParser
Parses the given JSON into aHeader
instance.- Specified by:
parseHeader
in interfaceJWTPartsParser
- Parameters:
json
- the content of the Header in a JSON representation.- Returns:
- the Header.
- Throws:
JWTDecodeException
- if the json doesn't have a proper JSON format.
-
-