|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nimbusds.jose.Header
com.nimbusds.jose.PlainHeader
public class PlainHeader
Plaintext JOSE header.
Supports all reserved header parameters
of the plain specification:
"none"
).
The header may also carry custom parameters
;
these will be serialised and parsed along the reserved ones.
Example:
{ "alg" : "none" }
Field Summary |
---|
Fields inherited from class com.nimbusds.jose.Header |
---|
alg |
Constructor Summary | |
---|---|
PlainHeader()
Creates a new plain header with algorithm none . |
Method Summary | |
---|---|
Algorithm |
getAlgorithm()
Gets the algorithm ( alg ) parameter. |
java.util.Set<java.lang.String> |
getIncludedParameters()
Gets the names of all included parameters (reserved and custom) in the header instance. |
static java.util.Set<java.lang.String> |
getReservedParameterNames()
Gets the reserved parameter names for plain headers. |
static PlainHeader |
parse(Base64URL base64URL)
Parses a plain header from the specified Base64URL. |
static PlainHeader |
parse(net.minidev.json.JSONObject json)
Parses a plain header from the specified JSON object. |
static PlainHeader |
parse(java.lang.String s)
Parses a plain header from the specified JSON string. |
void |
setCustomParameter(java.lang.String name,
java.lang.Object value)
Sets a custom (non-reserved) parameter. |
Methods inherited from class com.nimbusds.jose.Header |
---|
getContentType, getCustomParameter, getCustomParameters, getType, parseAlgorithm, setContentType, setCustomParameters, setType, toBase64URL, toJSONObject, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.nimbusds.jose.ReadOnlyHeader |
---|
getContentType, getCustomParameter, getCustomParameters, getType, toBase64URL, toJSONObject |
Constructor Detail |
---|
public PlainHeader()
none
.
Method Detail |
---|
public static java.util.Set<java.lang.String> getReservedParameterNames()
public Algorithm getAlgorithm()
ReadOnlyPlainHeader
alg
) parameter.
getAlgorithm
in interface ReadOnlyHeader
getAlgorithm
in interface ReadOnlyPlainHeader
Algorithm.NONE
.public void setCustomParameter(java.lang.String name, java.lang.Object value)
Header
setCustomParameter
in class Header
name
- The name of the custom parameter. Must not match a
reserved parameter name and must not be null
.value
- The value of the custom parameter, should map to a valid
JSON entity, null
if not specified.
java.lang.IllegalArgumentException
- If the specified parameter name
matches a reserved parameter name.public java.util.Set<java.lang.String> getIncludedParameters()
ReadOnlyHeader
getIncludedParameters
in interface ReadOnlyHeader
public static PlainHeader parse(net.minidev.json.JSONObject json) throws java.text.ParseException
json
- The JSON object to parse. Must not be null
.
java.text.ParseException
- If the specified JSON object doesn't represent
a valid plain header.public static PlainHeader parse(java.lang.String s) throws java.text.ParseException
s
- The JSON string to parse. Must not be null
.
java.text.ParseException
- If the specified JSON string doesn't
represent a valid plain header.public static PlainHeader parse(Base64URL base64URL) throws java.text.ParseException
base64URL
- The Base64URL to parse. Must not be null
.
java.text.ParseException
- If the specified Base64URL doesn't represent a
valid plain header.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |