public class JSONWebKey extends Object implements Buildable<JSONWebKey>
Modifier and Type | Field and Description |
---|---|
Algorithm |
alg
The "alg" parameter identifies the algorithm intended for use with this key.
|
String |
crv
The name of the Elliptic curve.
|
String |
d
The "d" parameter contains the private exponent value for the RSA private key as described in RFC 7518 Section 6.3.2.1
It is represented as a Base64urlUInt-encoded value.
|
String |
dp
The "dp" parameter contains the first factor CRT (Chinese Remainder Theorem) exponent factor for the RSA private
key.
|
String |
dq
The "dq" parameter contains the second factor CRT (Chinese Remainder Theorem) exponent factor for the RSA private
key.
|
String |
e
The "e" parameter contains the public exponent value for the RSA public key.
|
String |
kid
The key identifier.
|
KeyType |
kty
The key type parameter.
|
String |
n
The "n" parameter contains the modulus value for the RSA public key.
|
Map<String,Object> |
other
This Map will contain all the properties that aren't specifically defined in this class.
|
String |
p
The "p" parameter contains the first prime factor for the RSA private key.
|
String |
q
The "q" parameter contains the second prime factor for the RSA private key.
|
String |
qi
The "qi" parameter contains the first CRT (Chinese Remainder Theorem) coefficient factor for the RSA private key.
|
String |
use
The "use" parameter identifies the intended use of the public key.
|
String |
x
The "x" parameter is the x coordinate of the Elliptic Curve
|
List<String> |
x5c
The "x5c" parameter contains the encoded X509 certificate chain.
|
String |
x5t
The x.509 SHA-1 certificate thumbprint.
|
String |
x5t_256
The x.509 SHA-256 certificate thumbprint.
|
String |
y
The "y" parameter is the y coordinate of the Elliptic Curve
|
Constructor and Description |
---|
JSONWebKey() |
Modifier and Type | Method and Description |
---|---|
JSONWebKey |
add(String key,
Object value) |
static JSONWebKey |
build(Certificate certificate)
Build a JSON Web Key from a certificate
|
static JSONWebKey |
build(PrivateKey privateKey)
Build a JSON Web Key from a private key
|
static JSONWebKey |
build(PublicKey publicKey)
Build a JSON Web Key from a public key
|
static JSONWebKey |
build(String encodedPEM)
Build a JSON Web Key from an encoded PEM.
|
boolean |
equals(Object o) |
Map<String,Object> |
getOther() |
int |
hashCode() |
static PublicKey |
parse(JSONWebKey key)
Build a public key from a JSON Web Key containing a public RSA or EC key.
|
String |
toJSON() |
String |
toString() |
public Algorithm alg
public String crv
public String d
The "d" parameter contains the private key for an ECC Private Key as described in RFC 7518 Section 6.2.2.1
public String dp
public String dq
public String e
public String kid
public KeyType kty
public String n
public Map<String,Object> other
public String p
public String q
public String qi
public String use
public String x
public String x5t
public String x5t_256
public String y
public static JSONWebKey build(String encodedPEM)
encodedPEM
- an encoded PEMpublic static PublicKey parse(JSONWebKey key)
key
- a JSON web key containing a public keypublic static JSONWebKey build(Certificate certificate)
certificate
- the certificatepublic static JSONWebKey build(PrivateKey privateKey)
privateKey
- a private keypublic static JSONWebKey build(PublicKey publicKey)
publicKey
- a public keypublic JSONWebKey add(String key, Object value)
public String toJSON()
Copyright © 2021. All rights reserved.