com.nimbusds.jwt
Class PlainJWT

java.lang.Object
  extended by com.nimbusds.jose.JOSEObject
      extended by com.nimbusds.jose.PlainObject
          extended by com.nimbusds.jwt.PlainJWT
All Implemented Interfaces:
JWT

@ThreadSafe
public class PlainJWT
extends PlainObject
implements JWT

Plain JSON Web Token (JWT).

Version:
$version$ (2013-03-27)
Author:
Vladimir Dzhuvinov

Constructor Summary
PlainJWT(Base64URL firstPart, Base64URL secondPart)
          Creates a new plain JSON Web Token (JWT) with the specified Base64URL-encoded parts.
PlainJWT(JWTClaimsSet claimsSet)
          Creates a new plain JSON Web Token (JWT) with a default PlainHeader and the specified claims set.
PlainJWT(PlainHeader header, ReadOnlyJWTClaimsSet claimsSet)
          Creates a new plain JSON Web Token (JWT) with the specified header and claims set.
 
Method Summary
 ReadOnlyJWTClaimsSet getJWTClaimsSet()
          Gets the claims set of the JSON Web Token (JWT).
static PlainJWT parse(String s)
          Parses a plain JSON Web Token (JWT) from the specified string in compact format.
 
Methods inherited from class com.nimbusds.jose.PlainObject
getHeader, serialize
 
Methods inherited from class com.nimbusds.jose.JOSEObject
getParsedParts, getParsedString, getPayload, setParsedParts, setPayload, split
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.nimbusds.jwt.JWT
getHeader, getParsedParts, getParsedString, serialize
 

Constructor Detail

PlainJWT

public PlainJWT(JWTClaimsSet claimsSet)
Creates a new plain JSON Web Token (JWT) with a default PlainHeader and the specified claims set.

Parameters:
claimsSet - The JWT claims set. Must not be null.

PlainJWT

public PlainJWT(PlainHeader header,
                ReadOnlyJWTClaimsSet claimsSet)
Creates a new plain JSON Web Token (JWT) with the specified header and claims set.

Parameters:
header - The plain header. Must not be null.
claimsSet - The JWT claims set. Must not be null.

PlainJWT

public PlainJWT(Base64URL firstPart,
                Base64URL secondPart)
         throws ParseException
Creates a new plain JSON Web Token (JWT) with the specified Base64URL-encoded parts.

Parameters:
firstPart - The first part, corresponding to the plain header. Must not be null.
secondPart - The second part, corresponding to the claims set (payload). Must not be null.
Throws:
ParseException - If parsing of the serialised parts failed.
Method Detail

getJWTClaimsSet

public ReadOnlyJWTClaimsSet getJWTClaimsSet()
                                     throws ParseException
Description copied from interface: JWT
Gets the claims set of the JSON Web Token (JWT).

Specified by:
getJWTClaimsSet 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 PlainJWT parse(String s)
                      throws ParseException
Parses a plain JSON Web Token (JWT) from the specified string in compact format.

Parameters:
s - The string to parse. Must not be null.
Returns:
The plain JWT.
Throws:
ParseException - If the string couldn't be parsed to a valid plain JWT.


Copyright © 2013 NimbusDS. All Rights Reserved.