Package org.forgerock.json.jose.jwk
Class JWK
java.lang.Object
org.forgerock.json.jose.jwt.JWObject
org.forgerock.json.jose.jwk.JWK
The abstract base class for the 3 implementations of JWK.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The Algorithm key.protected static final String
The KeyID key.protected static final String
The KeyType key.protected static final String
The KeyUse key.protected static final String
The X509 chain key.protected static final String
The X509 thumbnail key.protected static final String
The X509 URL key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the alg parameter of the JWK.getKeyId()
Gets the kid parameter of the JWK.Gets the kty parameter of the JWK.getUse()
Gets the use parameter of the JWK.Gets a List of X509 chain certs.Gets the X509 thumbnail.Gets the X509 URL.static JWK
Parses a String into the proper JWK type.static JWK
Parses a JsonValue into the proper JWK type.Prints the JWK Object as a json string.protected static JsonValue
toJsonValue
(String json) Converts a String into a JsonValue.Methods inherited from class org.forgerock.json.jose.jwt.JWObject
checkListValuesAreOfType, checkValueIsOfType, get, isDefined, isValueOfType, keys, put, toJsonValue, toString
-
Field Details
-
KTY
The KeyType key.- See Also:
-
USE
The KeyUse key.- See Also:
-
ALG
The Algorithm key.- See Also:
-
KID
The KeyID key.- See Also:
-
X5U
The X509 URL key.- See Also:
-
X5T
The X509 thumbnail key.- See Also:
-
X5C
The X509 chain key.- See Also:
-
-
Constructor Details
-
JWK
Creates a JWK given the basic parameters.- Parameters:
kty
- the JWK key typeuse
- the JWK usealg
- the JWK algorithmkid
- the JWK key id
-
JWK
protected JWK(KeyType kty, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c) Creates a JWK given the basic parameters.- Parameters:
kty
- the JWK key typeuse
- the JWK usealg
- the JWK algorithmkid
- the JWK key idx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
-
Method Details
-
getKeyType
Gets the kty parameter of the JWK.- Returns:
- A KeyType for the JWK
-
getUse
Gets the use parameter of the JWK.- Returns:
- A String representing the use parameter
-
getAlgorithm
Gets the alg parameter of the JWK.- Returns:
- A String representing the alg parameter
-
getKeyId
Gets the kid parameter of the JWK.- Returns:
- A String representing the kid parameter
-
toJsonString
Prints the JWK Object as a json string.- Returns:
- A String representing JWK
-
parse
Parses a String into the proper JWK type.- Parameters:
json
- The json String.- Returns:
- A JWK object
- Throws:
JsonException
- If there is a problem parsing the json String.
-
parse
Parses a JsonValue into the proper JWK type.- Parameters:
jwk
- The JsonValue Object.- Returns:
- A JWK object
- Throws:
JsonException
- If there is a problem parsing the json String.
-
toJsonValue
Converts a String into a JsonValue.- Parameters:
json
- The json String.- Returns:
- A JsonValue object.
- Throws:
JsonException
- If there is a problem parsing the json String.
-
getX509URL
Gets the X509 URL.- Returns:
- the url of the 509 cert header or null
-
getX509Thumbnail
Gets the X509 thumbnail.- Returns:
- Base64url of the X509 thumbnail
-
getX509Chain
Gets a List of X509 chain certs.- Returns:
- X509 Cert Chain as list of encoded strings or null if none are available.
-