|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.jose.Header com.nimbusds.jose.JWEHeader
public class JWEHeader
JSON Web Encryption (JWE) header.
Supports all reserved header parameters
of the JWE specification:
The header may also carry custom parameters
;
these will be serialised and parsed along the reserved ones.
Example header:
{ "alg" : "RSA1_5", "enc" : "A128CBC-HS256" }
Field Summary |
---|
Fields inherited from class com.nimbusds.jose.Header |
---|
alg |
Constructor Summary | |
---|---|
JWEHeader(JWEAlgorithm alg,
EncryptionMethod enc)
Creates a new JSON Web Encryption (JWE) header. |
Method Summary | |
---|---|
Base64URL |
getAgreementPartyUInfo()
Gets the agreement PartyUInfo ( apu ) parameter. |
JWEAlgorithm |
getAlgorithm()
Gets the algorithm ( alg ) parameter. |
CompressionAlgorithm |
getCompressionAlgorithm()
Gets the compression algorithm ( zip ) parameter. |
EncryptionMethod |
getEncryptionMethod()
Gets the encryption method ( enc ) parameter. |
ECKey |
getEphemeralPublicKey()
Gets the Ephemeral Public Key ( epk ) parameter. |
Set<String> |
getIncludedParameters()
Gets the names of all included parameters (reserved and custom) in the header instance. |
JWK |
getJWK()
Gets the JSON Web Key (JWK) ( jwk ) parameter. |
JWK |
getJWK()
Gets the JSON Web Key (JWK) ( jwk ) parameter. |
URL |
getJWKURL()
Gets the JSON Web Key (JWK) Set URL ( jku ) parameter. |
URL |
getJWKURL()
Gets the JSON Web Key (JWK) Set URL ( jku ) parameter. |
String |
getKeyID()
Gets the key ID ( kid ) parameter. |
String |
getKeyID()
Gets the key ID ( kid ) parameter. |
static Set<String> |
getReservedParameterNames()
Gets the reserved parameter names for JWE headers. |
List<Base64> |
getX509CertChain()
Gets the X.509 certificate chain ( x5c ) parameter
corresponding to the key used to sign or encrypt the JWS / JWE
object. |
List<Base64> |
getX509CertChain()
Gets the X.509 certificate chain ( x5c ) parameter
corresponding to the key used to sign or encrypt the JWS / JWE
object. |
Base64URL |
getX509CertThumbprint()
Gets the X.509 certificate thumbprint ( x5t ) parameter. |
Base64URL |
getX509CertThumbprint()
Gets the X.509 certificate thumbprint ( x5t ) parameter. |
URL |
getX509CertURL()
Gets the X.509 certificate URL ( x5u ) parameter. |
URL |
getX509CertURL()
Gets the X.509 certificate URL ( x5u ) parameter. |
static JWEHeader |
parse(Base64URL base64URL)
Parses a JWE header from the specified Base64URL. |
static JWEHeader |
parse(net.minidev.json.JSONObject json)
Parses a JWE header from the specified JSON object. |
static JWEHeader |
parse(String s)
Parses a JWE header from the specified JSON string. |
void |
setAgreementPartyUInfo(Base64URL apu)
Sets the agreement PartyUInfo ( apu ) parameter. |
void |
setCompressionAlgorithm(CompressionAlgorithm zip)
Sets the compression algorithm ( zip ) parameter. |
void |
setCustomParameter(String name,
Object value)
Sets a custom (non-reserved) parameter. |
void |
setEphemeralPublicKey(ECKey epk)
Sets the Ephemeral Public Key ( epk ) parameter. |
void |
setJWK(JWK jwk)
Sets the JSON Web Key (JWK) ( jwk ) parameter. |
void |
setJWKURL(URL jku)
Sets the JSON Web Key (JWK) Set URL ( jku ) parameter. |
void |
setKeyID(String kid)
Sets the key ID ( kid ) parameter. |
void |
setX509CertChain(List<Base64> x5c)
Sets the X.509 certificate chain parameter ( x5c )
corresponding to the key used to sign or encrypt the JWS / JWE
object. |
void |
setX509CertThumbprint(Base64URL x5t)
Sets the X.509 certificate thumbprint ( x5t ) parameter. |
void |
setX509CertURL(URL x5u)
Sets the X.509 certificate URL ( x5u ) parameter. |
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of the header. |
Methods inherited from class com.nimbusds.jose.Header |
---|
getContentType, getCriticalHeaders, getCustomParameter, getCustomParameters, getType, parseAlgorithm, setContentType, setCriticalHeaders, setCustomParameters, setParsedBase64URL, setType, toBase64URL, 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, getCriticalHeaders, getCustomParameter, getCustomParameters, getType, toBase64URL, toString |
Constructor Detail |
---|
public JWEHeader(JWEAlgorithm alg, EncryptionMethod enc)
alg
- The JWE algorithm parameter. Must not be null
.enc
- The encryption method parameter. Must not be
null
.Method Detail |
---|
public static Set<String> getReservedParameterNames()
public JWEAlgorithm getAlgorithm()
ReadOnlyJWEHeader
alg
) parameter.
getAlgorithm
in interface ReadOnlyHeader
getAlgorithm
in interface ReadOnlyJWEHeader
public EncryptionMethod getEncryptionMethod()
ReadOnlyJWEHeader
enc
) parameter.
getEncryptionMethod
in interface ReadOnlyJWEHeader
public ECKey getEphemeralPublicKey()
ReadOnlyJWEHeader
epk
) parameter.
getEphemeralPublicKey
in interface ReadOnlyJWEHeader
null
if not
specified.public void setEphemeralPublicKey(ECKey epk)
epk
) parameter.
epk
- The Ephemeral Public Key parameter, null
if not
specified.public CompressionAlgorithm getCompressionAlgorithm()
ReadOnlyJWEHeader
zip
) parameter.
getCompressionAlgorithm
in interface ReadOnlyJWEHeader
null
if not
specified.public void setCompressionAlgorithm(CompressionAlgorithm zip)
zip
) parameter.
zip
- The compression algorithm parameter, null
if not
specified.public Base64URL getAgreementPartyUInfo()
ReadOnlyJWEHeader
apu
) parameter.
getAgreementPartyUInfo
in interface ReadOnlyJWEHeader
null
if not
specified.public void setAgreementPartyUInfo(Base64URL apu)
apu
) parameter.
apu
- The agreement PartyUInfo parameter, null
if not
specified.public void setCustomParameter(String name, 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.
IllegalArgumentException
- If the specified parameter name
matches a reserved parameter name.public Set<String> getIncludedParameters()
ReadOnlyHeader
getIncludedParameters
in interface ReadOnlyHeader
public net.minidev.json.JSONObject toJSONObject()
ReadOnlyHeader
toJSONObject
in interface ReadOnlyHeader
public static JWEHeader parse(net.minidev.json.JSONObject json) throws ParseException
json
- The JSON object to parse. Must not be null
.
ParseException
- If the specified JSON object doesn't
represent a valid JWE header.public static JWEHeader parse(String s) throws ParseException
s
- The JSON string to parse. Must not be null
.
ParseException
- If the specified JSON object string doesn't
represent a valid JWE header.public static JWEHeader parse(Base64URL base64URL) throws ParseException
base64URL
- The Base64URL to parse. Must not be null
.
ParseException
- If the specified Base64URL doesn't represent a
valid JWE header.public URL getJWKURL()
jku
) parameter.
null
if not
specified.public JWK getJWK()
jwk
) parameter.
null
if not
specified.public URL getX509CertURL()
x5u
) parameter.
null
if not
specified.public Base64URL getX509CertThumbprint()
x5t
) parameter.
null
if
not specified.public List<Base64> getX509CertChain()
x5c
) parameter
corresponding to the key used to sign or encrypt the JWS / JWE
object.
null
if not specified.public String getKeyID()
kid
) parameter.
null
if not specified.public URL getJWKURL()
jku
) parameter.
null
if not
specified.public void setJWKURL(URL jku)
jku
) parameter.
jku
- The JSON Web Key (JWK) Set URL parameter, null
if
not specified.public JWK getJWK()
jwk
) parameter.
null
if not
specified.public void setJWK(JWK jwk)
jwk
) parameter.
jwk
- The JSON Web Key (JWK) (jwk
) parameter,
null
if not specified.public URL getX509CertURL()
x5u
) parameter.
null
if not
specified.public void setX509CertURL(URL x5u)
x5u
) parameter.
x5u
- The X.509 certificate URL parameter, null
if not
specified.public Base64URL getX509CertThumbprint()
x5t
) parameter.
null
if
not specified.public void setX509CertThumbprint(Base64URL x5t)
x5t
) parameter.
x5t
- The X.509 certificate thumbprint parameter, null
if not specified.public List<Base64> getX509CertChain()
x5c
) parameter
corresponding to the key used to sign or encrypt the JWS / JWE
object.
null
if not specified.public void setX509CertChain(List<Base64> x5c)
x5c
)
corresponding to the key used to sign or encrypt the JWS / JWE
object.
x5c
- The X.509 certificate chain parameter, null
if
not specified.public String getKeyID()
kid
) parameter.
null
if not specified.public void setKeyID(String kid)
kid
) parameter.
kid
- The key ID parameter, null
if not specified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |