Package com.nimbusds.jose
Class UnprotectedHeader
java.lang.Object
com.nimbusds.jose.UnprotectedHeader
JSON Web Signature (JWS) or JSON Web Encryption (JWE) unprotected header
(in a JSON serialisation). This class is immutable.
- Version:
- 2021-10-05
- Author:
- Alexander Martynov, Vladimir Dzhuvinov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for constructing an unprotected JWS or JWE header. -
Method Summary
Modifier and TypeMethodDescriptionGets the names of the included parameters in this unprotected header.getKeyID()
Gets the key ID (kid
) parameter.Gets a parameter.static UnprotectedHeader
Parses an unprotected header from the specified JSON object.Returns a JSON object representation of this unprotected header.
-
Method Details
-
getKeyID
Gets the key ID (kid
) parameter.- Returns:
- The key ID parameter,
null
if not specified.
-
getParam
Gets a parameter.- Parameters:
name
- The name of the parameter. Must not benull
.- Returns:
- The parameter,
null
if not specified.
-
getIncludedParams
Gets the names of the included parameters in this unprotected header.- Returns:
- The included parameters.
-
toJSONObject
Returns a JSON object representation of this unprotected header.- Returns:
- The JSON object, empty if no parameters are specified.
-
parse
Parses an unprotected header from the specified JSON object.- Parameters:
jsonObject
- The JSON object,null
if not specified.- Returns:
- The unprotected header or
null
. - Throws:
ParseException
- If the JSON object couldn't be parsed to a valid unprotected header.
-