@ThreadSafe public class SignedJWT extends JWSObject implements JWT
JWSObject.State
MIME_TYPE_COMPACT, MIME_TYPE_JS
Constructor and Description |
---|
SignedJWT(Base64URL firstPart,
Base64URL secondPart,
Base64URL thirdPart)
Creates a new signed JSON Web Token (JWT) with the specified
serialised parts.
|
SignedJWT(JWSHeader header,
JWTClaimsSet claimsSet)
Creates a new to-be-signed JSON Web Token (JWT) with the specified
header and claims set.
|
Modifier and Type | Method and Description |
---|---|
JWTClaimsSet |
getJWTClaimsSet()
Gets the claims set of the JSON Web Token (JWT).
|
static SignedJWT |
parse(String s)
Parses a signed JSON Web Token (JWT) from the specified string in
compact format.
|
getHeader, getSignature, getSigningInput, getState, serialize, sign, verify
getParsedParts, getParsedString, getPayload, setParsedParts, setPayload, split
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHeader, getParsedParts, getParsedString, serialize
public SignedJWT(JWSHeader header, JWTClaimsSet claimsSet)
unsigned
.header
- The JWS header. Must not be null
.claimsSet
- The JWT claims set. Must not be null
.public SignedJWT(Base64URL firstPart, Base64URL secondPart, Base64URL thirdPart) throws ParseException
signed
.firstPart
- The first part, corresponding to the JWS header.
Must not be null
.secondPart
- The second part, corresponding to the claims set
(payload). Must not be null
.thirdPart
- The third part, corresponding to the signature.
Must not be null
.ParseException
- If parsing of the serialised parts failed.public JWTClaimsSet getJWTClaimsSet() throws ParseException
JWT
getJWTClaimsSet
in interface JWT
null
if not available (for an
encrypted JWT that isn't decrypted).ParseException
- If the payload of the JWT doesn't represent a
valid JSON object and a JWT claims set.public static SignedJWT parse(String s) throws ParseException
s
- The string to parse. Must not be null
.ParseException
- If the string couldn't be parsed to a valid
signed JWT.Copyright © 2017 Connect2id Ltd.. All rights reserved.