public class JsonWebSignature extends JsonWebToken
Sample usage:
public static void printPayload(JsonFactory jsonFactory, String tokenString) throws IOException {
JsonWebSignature jws = JsonWebSignature.parse(jsonFactory, tokenString);
System.out.println(jws.getPayload());
}
Implementation is not thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonWebSignature.Header
Header as specified in Reserved
Header Parameter Names.
|
static class |
JsonWebSignature.Parser
JWS parser.
|
JsonWebToken.Payload| Constructor and Description |
|---|
JsonWebSignature(JsonWebSignature.Header header,
JsonWebToken.Payload payload,
byte[] signatureBytes,
byte[] signedContentBytes) |
| Modifier and Type | Method and Description |
|---|---|
JsonWebSignature.Header |
getHeader()
Returns the header.
|
byte[] |
getSignatureBytes()
Returns the bytes of the signature.
|
byte[] |
getSignedContentBytes()
Returns the bytes of the signature content.
|
static JsonWebSignature |
parse(com.google.api.client.json.JsonFactory jsonFactory,
String tokenString)
Parses the given JWS token string and returns the parsed
JsonWebSignature. |
static JsonWebSignature.Parser |
parser(com.google.api.client.json.JsonFactory jsonFactory)
Returns a new instance of a JWS parser.
|
getPayloadpublic JsonWebSignature(JsonWebSignature.Header header, JsonWebToken.Payload payload, byte[] signatureBytes, byte[] signedContentBytes)
header - headerpayload - payloadsignatureBytes - bytes of the signaturesignedContentBytes - bytes of the signature contentpublic JsonWebSignature.Header getHeader()
JsonWebTokenSubclasses may override only to change the return type.
getHeader in class JsonWebTokenpublic final byte[] getSignatureBytes()
public final byte[] getSignedContentBytes()
public static JsonWebSignature parse(com.google.api.client.json.JsonFactory jsonFactory, String tokenString) throws IOException
JsonWebSignature.jsonFactory - JSON factorytokenString - JWS token stringIOExceptionpublic static JsonWebSignature.Parser parser(com.google.api.client.json.JsonFactory jsonFactory)
Copyright © 2011-2012 Google. All Rights Reserved.