Class JsonWebSignature.Parser

public static final class JsonWebSignature.Parser

JWS parser.

Implementation is not thread-safe.

Inheritance

java.lang.Object > JsonWebSignature.Parser

Constructors

Parser(JsonFactory jsonFactory)

public Parser(JsonFactory jsonFactory)
Parameter
NameDescription
jsonFactoryJsonFactory

JSON factory

Methods

getHeaderClass()

public Class<? extends JsonWebSignature.Header> getHeaderClass()

Returns the header class to use for parsing.

Returns
TypeDescription
Class<? extends com.google.api.client.json.webtoken.JsonWebSignature.Header>

getJsonFactory()

public JsonFactory getJsonFactory()

Returns the JSON factory.

Returns
TypeDescription
JsonFactory

getPayloadClass()

public Class<? extends JsonWebToken.Payload> getPayloadClass()

Returns the payload class to use for parsing.

Returns
TypeDescription
Class<? extends com.google.api.client.json.webtoken.JsonWebToken.Payload>

parse(String tokenString)

public JsonWebSignature parse(String tokenString)

Parses a JWS token into a parsed JsonWebSignature.

Parameter
NameDescription
tokenStringString

JWS token string

Returns
TypeDescription
JsonWebSignature

parsed JsonWebSignature

Exceptions
TypeDescription
IOException

setHeaderClass(Class<? extends JsonWebSignature.Header> headerClass)

public JsonWebSignature.Parser setHeaderClass(Class<? extends JsonWebSignature.Header> headerClass)

Sets the header class to use for parsing.

Parameter
NameDescription
headerClassClass<? extends com.google.api.client.json.webtoken.JsonWebSignature.Header>
Returns
TypeDescription
JsonWebSignature.Parser

setPayloadClass(Class<? extends JsonWebToken.Payload> payloadClass)

public JsonWebSignature.Parser setPayloadClass(Class<? extends JsonWebToken.Payload> payloadClass)

Sets the payload class to use for parsing.

Parameter
NameDescription
payloadClassClass<? extends com.google.api.client.json.webtoken.JsonWebToken.Payload>
Returns
TypeDescription
JsonWebSignature.Parser