public abstract class CommonSEHeader extends Header implements ReadOnlyCommonSEHeader
Supports all reserved header parameters shared by the JWS and JWE specifications:
Modifier | Constructor and Description |
---|---|
protected |
CommonSEHeader(Algorithm alg)
Creates a new common JWS and JWE header with the specified algorithm
(
alg ) parameter. |
Modifier and Type | Method and Description |
---|---|
JWK |
getJWK()
Gets the JSON Web Key (JWK) (
jwk ) parameter. |
java.net.URL |
getJWKURL()
Gets the JSON Web Key (JWK) Set URL (
jku ) parameter. |
java.lang.String |
getKeyID()
Gets the key ID (
kid ) parameter. |
Base64[] |
getX509CertChain()
Gets the X.509 certificate chain parameter (
x5c )
corresponding to the key used to sign or encrypt the JWS/JWE object. |
Base64URL |
getX509CertThumbprint()
Gets the X.509 certificate thumbprint (
x5t ) parameter. |
java.net.URL |
getX509CertURL()
Gets the X.509 certificate URL (
x5u ) parameter. |
protected static Base64[] |
parseX509CertChain(net.minidev.json.JSONArray jsonArray)
Parses an X.509 certificate chain from the specified JSON array.
|
void |
setJWK(JWK jwk)
Sets the JSON Web Key (JWK) (
jwk ) parameter. |
void |
setJWKURL(java.net.URL jku)
Sets the JSON Web Key (JWK) Set URL (
jku ) parameter. |
void |
setKeyID(java.lang.String kid)
Sets the key ID (
kid ) parameter. |
void |
setX509CertChain(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(java.net.URL x5u)
Sets the X.509 certificate URL (
x5u ) parameter. |
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of the header.
|
getContentType, getCustomParameter, getCustomParameters, getType, parse, parseAlgorithm, setContentType, setCustomParameter, setCustomParameters, setType, toBase64URL, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAlgorithm, getContentType, getCustomParameter, getCustomParameters, getIncludedParameters, getType, toBase64URL
protected CommonSEHeader(Algorithm alg)
alg
) parameter.alg
- The algorithm parameter. Must not be null
.public java.net.URL getJWKURL()
ReadOnlyCommonSEHeader
jku
) parameter.getJWKURL
in interface ReadOnlyCommonSEHeader
null
if not
specified.public void setJWKURL(java.net.URL jku)
jku
) parameter.jku
- The JSON Web Key (JWK) Set URL parameter, null
if
not specified.public JWK getJWK()
ReadOnlyCommonSEHeader
jwk
) parameter.getJWK
in interface ReadOnlyCommonSEHeader
null
if not
specified.public void setJWK(JWK jwk)
jwk
) parameter.jwk
- The JSON Web Key (JWK) (jwk
) parameter,
null
if not specified.public java.net.URL getX509CertURL()
ReadOnlyCommonSEHeader
x5u
) parameter.getX509CertURL
in interface ReadOnlyCommonSEHeader
null
if not
specified.public void setX509CertURL(java.net.URL x5u)
x5u
) parameter.x5u
- The X.509 certificate URL parameter, null
if not
specified.public Base64URL getX509CertThumbprint()
ReadOnlyCommonSEHeader
x5t
) parameter.getX509CertThumbprint
in interface ReadOnlyCommonSEHeader
null
if
not specified.public void setX509CertThumbprint(Base64URL x5t)
x5t
) parameter.x5t
- The X.509 certificate thumbprint parameter, null
if not specified.public Base64[] getX509CertChain()
ReadOnlyCommonSEHeader
x5c
)
corresponding to the key used to sign or encrypt the JWS/JWE object.getX509CertChain
in interface ReadOnlyCommonSEHeader
null
if not
specified.public void setX509CertChain(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 java.lang.String getKeyID()
ReadOnlyCommonSEHeader
kid
) parameter.getKeyID
in interface ReadOnlyCommonSEHeader
null
if not specified.public void setKeyID(java.lang.String kid)
kid
) parameter.kid
- The key ID parameter, null
if not specified.public net.minidev.json.JSONObject toJSONObject()
ReadOnlyHeader
toJSONObject
in interface ReadOnlyHeader
toJSONObject
in class Header
protected static Base64[] parseX509CertChain(net.minidev.json.JSONArray jsonArray) throws java.text.ParseException
jsonArray
- The JSON array to parse. Must not be null
.java.text.ParseException
- If the X.509 certificate chain couldn't be
parsed.Copyright © 2013 NimbusDS. All Rights Reserved.