Package com.auth0.jwt.impl
Class JWTParser
java.lang.Object
com.auth0.jwt.impl.JWTParser
- All Implemented Interfaces:
JWTPartsParser
This class helps in decoding the Header and Payload of the JWT using
HeaderSerializer
and PayloadSerializer
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseHeader
(String json) Parses the given JSON into aHeader
instance.parsePayload
(String json) Parses the given JSON into aPayload
instance.
-
Constructor Details
-
JWTParser
public JWTParser()
-
-
Method Details
-
parsePayload
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
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.
-