@ThreadSafe public class PlainObject extends JOSEObject
MIME_TYPE_COMPACT, MIME_TYPE_JS| Constructor and Description |
|---|
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(ReadOnlyPlainHeader header,
Payload payload)
Creates a new plaintext JOSE object with the specified header and
payload.
|
| Modifier and Type | Method and Description |
|---|---|
ReadOnlyPlainHeader |
getHeader()
Gets the header of this JOSE object.
|
static PlainObject |
parse(java.lang.String s)
Parses a plaintext JOSE object from the specified string in compact
format.
|
java.lang.String |
serialize()
Serialises this plaintext JOSE object to its compact format
consisting of Base64URL-encoded parts delimited by period ('.')
characters.
|
getParsedParts, getParsedString, getPayload, setParsedParts, setPayload, splitpublic PlainObject(Payload payload)
PlainHeader and the specified payload.payload - The payload. Must not be null.public PlainObject(ReadOnlyPlainHeader header, Payload payload)
header - The plaintext header. Must not be null.payload - The payload. Must not be null.public PlainObject(Base64URL firstPart, Base64URL secondPart) throws java.text.ParseException
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.java.text.ParseException - If parsing of the serialised parts failed.public ReadOnlyPlainHeader getHeader()
JOSEObjectgetHeader in class JOSEObjectpublic java.lang.String serialize()
[header-base64url].[payload-base64url].[]
serialize in class JOSEObjectpublic static PlainObject parse(java.lang.String s) throws java.text.ParseException
s - The string to parse. Must not be null.java.text.ParseException - If the string couldn't be parsed to a valid
plaintext JOSE object.Copyright © 2014 Connect2id Ltd.. All Rights Reserved.