Modifier and Type | Class and Description |
---|---|
static class |
JWK.Builder<B extends JWK.Builder>
JWK builder.
|
Modifier and Type | Field and Description |
---|---|
protected static String |
JSON_KEY_ALG
The Algorithm key.
|
protected static String |
JSON_KEY_KID
The KeyID key.
|
protected static String |
JSON_KEY_KTY
The KeyType key.
|
protected static String |
JSON_KEY_OPERATIONS
The KeyOperations key.
|
protected static String |
JSON_KEY_USE
The KeyUse key.
|
protected static String |
JSON_KEY_X5C
The X509 chain key.
|
protected static String |
JSON_KEY_X5T
The X509 thumbnail key.
|
protected static String |
JSON_KEY_X5U
The X509 URL key.
|
Modifier | Constructor and Description |
---|---|
protected |
JWK(KeyType keyType,
KeyUse use,
Set<KeyOperation> keyOperations,
Algorithm algorithm,
String keyId,
String x509url,
String x509Thumbnail,
List<String> x509Chain)
Creates a JWK given the basic parameters.
|
protected |
JWK(KeyType keyType,
KeyUse use,
String algorithm,
String keyId)
Deprecated.
Use the builder instead.
|
protected |
JWK(KeyType keyType,
KeyUse use,
String algorithm,
String keyId,
String x509url,
String x509Thumbnail,
List<String> x509Chain)
Deprecated.
Use the builder instead.
|
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
Deprecated.
replaced by
JWK.getJwaAlgorithm() |
static Algorithm |
getAlgorithm(String algorithmName)
Get the algorithm corresponding.
|
Algorithm |
getJwaAlgorithm()
Gets the alg parameter of the JWK.
|
String |
getKeyId()
Gets the keyId parameter of the JWK.
|
Set<KeyOperation> |
getKeyOperations()
Gets the key operations parameter of the JWK.
|
KeyType |
getKeyType()
Gets the kty parameter of the JWK.
|
protected abstract Optional<JWK.Builder<?>> |
getPublicJwkBuilder()
Return a builder with all the values set for representing the public components of the JWK.
|
KeyUse |
getUse()
Gets the use parameter of the JWK.
|
List<String> |
getX509Chain()
Gets a List of X509 chain certs.
|
String |
getX509Thumbnail()
Gets the X509 thumbnail.
|
String |
getX509URL()
Gets the X509 URL.
|
boolean |
isPrivate()
Indicates if any private key attributes are present in the JWK.
|
protected static void |
loadJWKFromJson(JWK.Builder builder,
JsonValue json)
Load the generic JWK attributes from the json, by side effect.
|
static JWK |
parse(JsonValue jwk)
Parses a JsonValue into the proper JWK type.
|
static JWK |
parse(String json)
Parses a String into the proper JWK type.
|
protected void |
putField(JsonValue jsonValue,
String key,
Object value)
Add a string value into a json only if it's not null.
|
String |
toJsonString()
Prints the JWK Object as a json string.
|
JsonValue |
toJsonValue()
Returns a json representation of the JWK.
|
protected static JsonValue |
toJsonValue(String json)
Converts a String into a JsonValue.
|
Optional<JWK> |
toPublicJwk()
For asymmetric keys, get the public JWK representation of this JWK.
|
protected static final String JSON_KEY_KTY
protected static final String JSON_KEY_USE
protected static final String JSON_KEY_OPERATIONS
protected static final String JSON_KEY_ALG
protected static final String JSON_KEY_KID
protected static final String JSON_KEY_X5U
protected static final String JSON_KEY_X5T
protected static final String JSON_KEY_X5C
@Deprecated protected JWK(KeyType keyType, KeyUse use, String algorithm, String keyId)
keyType
- the JWK key typeuse
- the JWK usealgorithm
- the JWK algorithmkeyId
- the JWK key id@Deprecated protected JWK(KeyType keyType, KeyUse use, String algorithm, String keyId, String x509url, String x509Thumbnail, List<String> x509Chain)
keyType
- the JWK key typeuse
- the JWK usealgorithm
- the JWK algorithmkeyId
- the JWK key idx509url
- the x509 url for the keyx509Thumbnail
- the x509 thumbnail for the keyx509Chain
- the x509 chain as a list of Base64 encoded stringsprotected JWK(KeyType keyType, KeyUse use, Set<KeyOperation> keyOperations, Algorithm algorithm, String keyId, String x509url, String x509Thumbnail, List<String> x509Chain)
keyType
- the JWK key typeuse
- the JWK usekeyOperations
- the JWK key Operationsalgorithm
- the JWK algorithmkeyId
- the JWK key idx509url
- the x509 url for the keyx509Thumbnail
- the x509 thumbnail for the keyx509Chain
- the x509 chain as a list of Base64 encoded stringspublic KeyType getKeyType()
public KeyUse getUse()
public Set<KeyOperation> getKeyOperations()
@Deprecated public String getAlgorithm()
JWK.getJwaAlgorithm()
public Algorithm getJwaAlgorithm()
public String getKeyId()
public String toJsonString()
public JsonValue toJsonValue()
protected void putField(JsonValue jsonValue, String key, Object value)
jsonValue
- the jsonkey
- the Map
key or List
index identifying the child value to set.value
- the value to assign to the member.public static JWK parse(String json)
json
- The json String.JsonException
- If there is a problem parsing the json String.public static JWK parse(JsonValue jwk)
jwk
- The JsonValue Object.JsonException
- If there is a problem parsing the json String.protected static void loadJWKFromJson(JWK.Builder builder, JsonValue json)
builder
- builder will be modified by side effect.json
- the json value.public static Algorithm getAlgorithm(String algorithmName)
algorithmName
- The algorithm name..IllegalArgumentException
- If the algorithm is not supported.protected static JsonValue toJsonValue(String json)
json
- The json String.JsonException
- If there is a problem parsing the json String.public String getX509URL()
public String getX509Thumbnail()
public List<String> getX509Chain()
public boolean isPrivate()
public Optional<JWK> toPublicJwk()
protected abstract Optional<JWK.Builder<?>> getPublicJwkBuilder()
JWK.toPublicJwk()
.Copyright © 2010-2018, ForgeRock All Rights Reserved.