com.nimbusds.jose
Class PlainObject

java.lang.Object
  extended by com.nimbusds.jose.JOSEObject
      extended by com.nimbusds.jose.PlainObject
Direct Known Subclasses:
PlainJWT

@ThreadSafe
public class PlainObject
extends JOSEObject

Plaintext (unsecured) JOSE object. This class is thread-safe.

Version:
$version$ (2012-10-23)
Author:
Vladimir Dzhuvinov

Constructor Summary
PlainObject(Base64URL firstPart, Base64URL secondPart)
          Creates a new plaintext JOSE object with the specified Base64URL-encoded parts.
PlainObject(Payload payload)
          Creates a new plaintext JOSE object with a default PlainHeader and the specified payload.
PlainObject(PlainHeader header, Payload payload)
          Creates a new plaintext JOSE object with the specified header and payload.
 
Method Summary
 ReadOnlyPlainHeader getHeader()
          Gets the header of this JOSE object.
static PlainObject parse(String s)
          Parses a plaintext JOSE object from the specified string in compact format.
 String serialize()
          Serialises this plaintext JOSE object to its compact format consisting of Base64URL-encoded parts delimited by period ('.') characters.
 
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
 

Constructor Detail

PlainObject

public PlainObject(Payload payload)
Creates a new plaintext JOSE object with a default PlainHeader and the specified payload.

Parameters:
payload - The payload. Must not be null.

PlainObject

public PlainObject(PlainHeader header,
                   Payload payload)
Creates a new plaintext JOSE object with the specified header and payload.

Parameters:
header - The plaintext header. Must not be null.
payload - The payload. Must not be null.

PlainObject

public PlainObject(Base64URL firstPart,
                   Base64URL secondPart)
            throws ParseException
Creates a new plaintext JOSE object with the specified Base64URL-encoded parts.

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

getHeader

public ReadOnlyPlainHeader getHeader()
Description copied from class: JOSEObject
Gets the header of this JOSE object.

Specified by:
getHeader in class JOSEObject
Returns:
The header.

serialize

public String serialize()
Serialises this plaintext JOSE object to its compact format consisting of Base64URL-encoded parts delimited by period ('.') characters.
 [header-base64url].[payload-base64url].[]
 

Specified by:
serialize in class JOSEObject
Returns:
The serialised plaintext JOSE object.

parse

public static PlainObject parse(String s)
                         throws ParseException
Parses a plaintext JOSE object from the specified string in compact format.

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


Copyright © 2013 NimbusDS. All Rights Reserved.