public static final class JsonWebSignature.Parser
JWS parser.
Implementation is not thread-safe.
Constructors
Parser(JsonFactory jsonFactory)
public Parser(JsonFactory jsonFactory)
Parameter | |
---|---|
Name | Description |
jsonFactory |
JsonFactory JSON factory |
Methods
getHeaderClass()
public Class<? extends JsonWebSignature.Header> getHeaderClass()
Returns the header class to use for parsing.
Returns | |
---|---|
Type | Description |
Class<? extends com.google.api.client.json.webtoken.JsonWebSignature.Header> |
getJsonFactory()
public JsonFactory getJsonFactory()
Returns the JSON factory.
Returns | |
---|---|
Type | Description |
JsonFactory |
getPayloadClass()
public Class<? extends JsonWebToken.Payload> getPayloadClass()
Returns the payload class to use for parsing.
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
tokenString |
String JWS token string |
Returns | |
---|---|
Type | Description |
JsonWebSignature |
parsed JsonWebSignature |
Exceptions | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
headerClass |
Class<? extends com.google.api.client.json.webtoken.JsonWebSignature.Header> |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
payloadClass |
Class<? extends com.google.api.client.json.webtoken.JsonWebToken.Payload> |
Returns | |
---|---|
Type | Description |
JsonWebSignature.Parser |