com.nimbusds.jwt
Class SignedJWT
java.lang.Object
com.nimbusds.jose.JOSEObject
com.nimbusds.jose.JWSObject
com.nimbusds.jwt.SignedJWT
- All Implemented Interfaces:
- JWT
@ThreadSafe
public class SignedJWT
- extends JWSObject
- implements JWT
Signed JSON Web Token (JWT).
- Version:
- $version$ (2012-10-23)
- Author:
- Vladimir Dzhuvinov
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SignedJWT
public SignedJWT(JWSHeader header,
ClaimsSet claimsSet)
- Creates a new to-be-signed JSON Web Token (JWT) with the specified
header and claims set. The initial state will be
unsigned
.
- Parameters:
header
- The JWS header. Must not be null
.claimsSet
- The claims set. Must not be null
.
SignedJWT
public SignedJWT(Base64URL firstPart,
Base64URL secondPart,
Base64URL thirdPart)
throws ParseException
- Creates a new signed JSON Web Token (JWT) with the specified
serialised parts. The state will be
signed
.
- Parameters:
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
.
- Throws:
ParseException
- If parsing of the serialised parts failed.
getClaimsSet
public ReadOnlyClaimsSet getClaimsSet()
throws ParseException
- Description copied from interface:
JWT
- Gets the claims set of the JSON Web Token (JWT).
- Specified by:
getClaimsSet
in interface JWT
- Returns:
- The claims set,
null
if not available (for an
encrypted JWT that isn't decrypted).
- Throws:
ParseException
- If the payload of the JWT doesn't represent a
valid JSON object and a JWT claims set.
parse
public static SignedJWT parse(String s)
throws ParseException
- Parses a signed JSON Web Token (JWT) from the specified string in
compact format.
- Parameters:
s
- The string to parse. Must not be null
.
- Returns:
- The signed JWT.
- Throws:
ParseException
- If the string couldn't be parsed to a valid
signed JWT.
Copyright © 2013 NimbusDS. All Rights Reserved.