Package org.forgerock.json.jose.jwk
Class OctJWK
java.lang.Object
org.forgerock.json.jose.jwk.JWK
org.forgerock.json.jose.jwk.OctJWK
Creates an Octet JWK.
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.forgerock.json.jose.jwk.JWK
JSON_KEY_ALG, JSON_KEY_KID, JSON_KEY_KTY, JSON_KEY_OPERATIONS, JSON_KEY_USE, JSON_KEY_X5C, JSON_KEY_X5T, JSON_KEY_X5T_S256, JSON_KEY_X5U
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OctJWK.Builder
Get the Octet JWK builder.getKey()
Gets the symmetric key.protected Optional<JWK.Builder<?>>
Return a builder with all the values set for representing the public components of the JWK.boolean
Indicates if any private key attributes are present in the JWK.static OctJWK
Parses a OctJWK object from a string json object.static OctJWK
Parses a OctJWK object from a jsonValue object.Returns a json representation of the JWK.Returns the key as a secret key.Methods inherited from class org.forgerock.json.jose.jwk.JWK
getAlgorithm, getAlgorithm, getJwaAlgorithm, getJwkThumbprint, getKeyId, getKeyOperations, getKeyType, getUse, getX509Chain, getX509Thumbnail, getX509Thumbprint, getX509ThumbprintS256, getX509URL, loadJWKFromJson, putField, toCryptoKey, toJsonString, toJsonValue, toPublicJwk, toSecretBuilder
-
Constructor Details
-
OctJWK
@Deprecated public OctJWK(String use, String alg, String kid, String key, String x5u, String x5t, List<String> x5c) Deprecated.Use the builder instead.Constructs a OctJWK.- Parameters:
use
- the JWK usealg
- the JWK algorithmkid
- the JWK key idkey
- the symmetric keyx5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded strings
-
-
Method Details
-
builder
Get the Octet JWK builder.- Parameters:
key
- the symmetric key- Returns:
- the builder
-
getKey
Gets the symmetric key.- Returns:
- the symmetric key that is Base64url encoded
-
toSecretKey
Returns the key as a secret key.- Returns:
- the secret key bytes.
-
parse
Parses a OctJWK object from a string json object.- Parameters:
json
- string json object- Returns:
- a OctJWK
-
parse
Parses a OctJWK object from a jsonValue object.- Parameters:
json
- an JsonValue object- Returns:
- a OctJWK
-
toJsonValue
Description copied from class:JWK
Returns a json representation of the JWK.- Overrides:
toJsonValue
in classJWK
- Returns:
- A JSON representation.
-
isPrivate
public boolean isPrivate()Description copied from class:JWK
Indicates if any private key attributes are present in the JWK. -
getPublicJwkBuilder
Description copied from class:JWK
Return a builder with all the values set for representing the public components of the JWK. Common JWK attributes will be added inJWK.toPublicJwk()
.- Specified by:
getPublicJwkBuilder
in classJWK
- Returns:
- The builder.
-