com.nimbusds.jose
Interface ReadOnlyHeader

All Known Subinterfaces:
ReadOnlyCommonSEHeader, ReadOnlyJWEHeader, ReadOnlyJWSHeader, ReadOnlyPlainHeader
All Known Implementing Classes:
CommonSEHeader, Header, JWEHeader, JWSHeader, PlainHeader

public interface ReadOnlyHeader

Read-only view of a header.

Version:
$version$ (2013-05-07)
Author:
Vladimir Dzhuvinov

Method Summary
 Algorithm getAlgorithm()
          Gets the algorithm (alg) parameter.
 String getContentType()
          Gets the content type (cty) parameter.
 Set<String> getCriticalHeaders()
          Gets the critical headers (crit) parameter.
 Object getCustomParameter(String name)
          Gets a custom (non-reserved) parameter.
 Map<String,Object> getCustomParameters()
          Gets the custom (non-reserved) parameters.
 Set<String> getIncludedParameters()
          Gets the names of all included parameters (reserved and custom) in the header instance.
 JOSEObjectType getType()
          Gets the type (typ) parameter.
 Base64URL toBase64URL()
          Returns a Base64URL representation of the header.
 net.minidev.json.JSONObject toJSONObject()
          Returns a JSON object representation of the header.
 String toString()
          Returns a JSON string representation of the header.
 

Method Detail

getAlgorithm

Algorithm getAlgorithm()
Gets the algorithm (alg) parameter.

Returns:
The algorithm parameter.

getType

JOSEObjectType getType()
Gets the type (typ) parameter.

Returns:
The type parameter, null if not specified.

getContentType

String getContentType()
Gets the content type (cty) parameter.

Returns:
The content type parameter, null if not specified.

getCriticalHeaders

Set<String> getCriticalHeaders()
Gets the critical headers (crit) parameter.

Returns:
The names of the critical header parameters, empty set or null if none.

getCustomParameter

Object getCustomParameter(String name)
Gets a custom (non-reserved) parameter.

Parameters:
name - The name of the custom parameter. Must not be null.
Returns:
The custom parameter, null if not specified.

getCustomParameters

Map<String,Object> getCustomParameters()
Gets the custom (non-reserved) parameters.

Returns:
The custom parameters, as a unmodifiable map, empty map if none.

getIncludedParameters

Set<String> getIncludedParameters()
Gets the names of all included parameters (reserved and custom) in the header instance.

Returns:
The included parameters.

toJSONObject

net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of the header. All custom parameters are included if they serialise to a JSON entity and their names don't conflict with the reserved ones.

Returns:
The JSON object representation of the header.

toString

String toString()
Returns a JSON string representation of the header. All custom parameters will be included if they serialise to a JSON entity and their names don't conflict with the reserved ones.

Overrides:
toString in class Object
Returns:
The JSON string representation of the header.

toBase64URL

Base64URL toBase64URL()
Returns a Base64URL representation of the header. If the header was parsed always returns the original Base64URL (required for JWS validation and authenticated JWE decryption).

Returns:
The original parsed Base64URL representation of the header, or a new Base64URL representation if the header was created from scratch.


Copyright © 2013 NimbusDS. All Rights Reserved.