public class JWE extends Object
Supports all Principal Registered Parameter Names of the JWE specification:
Example header:
{ "alg":"RSA1_5", "kid":"2011-04-29", "enc":"A128CBC-HS256", "jku":"https://server.example.com/keys.jwks" }
Modifier | Constructor and Description |
---|---|
protected |
JWE(javax.json.JsonObject headers)
Instantiates a new JWE.
|
Modifier and Type | Method and Description |
---|---|
String |
encode()
Encodes the JSON representation of headers of a JWE according to the specification.
|
String |
getAlgorithm()
Gets the algorithm used to encrypt or determine the value of the Content Encryption Key (CEK).
|
String |
getCEKBitLength()
Gets the Content Encryption Key bit length.
|
String |
getCompressionAlgorithm()
Gets the compression algorithm.
|
String |
getContentType()
Gets the content type of JOSE Header.
|
List<String> |
getCriticalHeader()
Gets the critical header.
|
String |
getEncryptionAlgorithm()
Gets the encryption algorithm used to encrypt the Plaintext to produce the Ciphertext.
|
String |
getHeader(String name)
Gets the string representation of headers.
|
javax.json.JsonObject |
getHeaders()
Gets the
JsonObject headers. |
List<String> |
getHeaderValues(String name)
Gets the header values for the specified name.
|
javax.json.JsonObject |
getJsonObject()
Gets the
JsonObject . |
String |
getJWK()
Gets the JWK.
|
String |
getJWKSet()
Gets the JWK Set.
|
String |
getKeyIdentifier()
Gets the key identifier used to determine the private key needed to decrypt the JWE.
|
String |
getType()
Gets the type of JOSE Header.
|
List<String> |
getX509CertificateChain()
Gets the x509 certificate chain.
|
String |
getX509SHA1CertificateThumbprint()
Gets the x509 SHA1 certificate thumbprint.
|
String |
getX509SHA256CertificateThumbprint()
Gets the x509 SHA256 certificate thumbprint.
|
String |
getX509Url()
Gets the x509 URL.
|
String |
toString() |
protected JWE(javax.json.JsonObject headers)
headers
- the headerspublic String encode()
Encodes the JSON representation of headers of a JWE according to the specification.
In order to decode, refer to the corresponding JWEBuilder
of this class.
public String getType()
public String getContentType()
public String getAlgorithm()
#RSA1_5
RSA-OAEP
RSA-OAEP-256
public String getEncryptionAlgorithm()
A128CBC-HS256
A192CBC-HS384
A256CBC-HS512
#A128GCM
#A192GCM
#A256GCM
public String getCEKBitLength()
public String getKeyIdentifier()
public String getCompressionAlgorithm()
public String getJWKSet()
The JWK Set resource contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.
public String getJWK()
JWK key is the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.
public String getX509Url()
X.509 public key certificate or certificate chain [RFC5280] contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.
public List<String> getX509CertificateChain()
The X.509 public key certificate or certificate chain [RFC5280] contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.
public String getX509SHA1CertificateThumbprint()
The certificate referenced by the thumbprint contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.
public String getX509SHA256CertificateThumbprint()
The certificate referenced by the thumbprint contains the public key to which the JWE was encrypted; this can be used to determine the private key needed to decrypt the JWE.
public List<String> getCriticalHeader()
The "crit" (critical) Header Parameter indicates that extensions to the initial RFC versions of [[ this specification ]] and [JWA] are being used that MUST be understood and processed. Its value is an array listing the Header Parameter names present in the JOSE Header that use those extensions.
public String toString()
toString
in class Object
Object.toString()
public javax.json.JsonObject getHeaders()
JsonObject
headers.public String getHeader(String name)
name
- the namepublic List<String> getHeaderValues(String name)
name
- the namepublic javax.json.JsonObject getJsonObject()
JsonObject
.Copyright © 2014. All rights reserved.