Package org.forgerock.json.jose.jwk
Class JWK.Builder<B extends JWK.Builder>
java.lang.Object
org.forgerock.json.jose.jwk.JWK.Builder<B>
- Type Parameters:
B
- The current builder.
- Direct Known Subclasses:
EcJWK.Builder
,OctJWK.Builder
,OkpJWK.Builder
,RsaJWK.Builder
- Enclosing class:
- JWK
JWK builder.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Algorithm
The intended JOSE algorithm for the key, optional.protected String
The key ID, optional.protected Set<KeyOperation>
The key operations, optional.protected KeyType
The key type, required.protected String
The key use, optional.The X.509 certificate chain, optional.protected String
X.509 certificate thumbprint, optional.protected String
X.509 certificate URL, optional. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the algorithm parameter of the JWK.Sets the algorithm parameter of the JWK.abstract JWK
build()
Builds the JWK.Sets the keyId parameter of the JWK.keyOperations
(Set<KeyOperation> keyOperations) Set the key operations parameter of the JWK.Set the key use parameter of the JWK.Sets the SHA-1 X509 thumbprint based on the configuredx509Chain(List)
.Sets the SHA-256 X509 thumbprint based on the configuredx509Chain(List)
.Set the X509 certificates attributes.x509Thumbnail
(String x509Thumbnail) Deprecated.x509Thumbprint
(String x509Thumbprint) Sets the SHA-1 X509 thumbprint.x509ThumbprintS256
(String x509Thumbprint) Sets the SHA-256 X509 thumbprint.Gets the X509 URL.
-
Field Details
-
keyType
The key type, required. -
use
The key use, optional. -
keyOperations
The key operations, optional. -
algorithm
The intended JOSE algorithm for the key, optional. -
keyId
The key ID, optional. -
x509url
X.509 certificate URL, optional. -
x509Thumbnail
X.509 certificate thumbprint, optional. -
x509Chain
The X.509 certificate chain, optional.
-
-
Constructor Details
-
Builder
The builder constructor.- Parameters:
keyType
- the JWK key type
-
-
Method Details
-
keyUse
Set the key use parameter of the JWK.- Parameters:
use
- the JWK use- Returns:
- the current builder
-
keyOperations
Set the key operations parameter of the JWK.- Parameters:
keyOperations
- the JWK key Operations- Returns:
- the current builder
-
algorithm
Sets the algorithm parameter of the JWK.- Parameters:
algorithm
- the JWK algorithm- Returns:
- the current builder
-
algorithm
Sets the algorithm parameter of the JWK.- Parameters:
algorithm
- the JWK algorithm- Returns:
- the current builder
-
keyId
Sets the keyId parameter of the JWK.- Parameters:
keyId
- the JWK key id- Returns:
- the current builder
-
x509Url
Gets the X509 URL.- Parameters:
x509url
- the x509 url for the key- Returns:
- the current builder
-
x509Thumbnail
Deprecated.Usex509Thumbprint(String)
orx509ThumbprintS256(String)
instead.Sets the X509 thumbprint.- Parameters:
x509Thumbnail
- the x509 thumbprint for the key- Returns:
- the current builder
-
x509Thumbprint
Sets the SHA-1 X509 thumbprint. You should prefer to usex509ThumbprintS256(String)
instead in most cases.- Parameters:
x509Thumbprint
- the x509 thumbprint for the key- Returns:
- the current builder
-
withX509Thumbprint
Sets the SHA-1 X509 thumbprint based on the configuredx509Chain(List)
.- Returns:
- the current builder
- Throws:
IllegalStateException
- if no X509 certificate has been set.
-
x509ThumbprintS256
Sets the SHA-256 X509 thumbprint.- Parameters:
x509Thumbprint
- the SHA-256 x509 thumbprint for the key- Returns:
- the current builder
-
withX509ThumbprintS256
Sets the SHA-256 X509 thumbprint based on the configuredx509Chain(List)
.- Returns:
- the current builder
- Throws:
IllegalStateException
- if no X509 certificate has been set.
-
x509Chain
Set the X509 certificates attributes.- Parameters:
x509Chain
- the x509 chain as a list of Base64 encoded strings- Returns:
- the current builder
-
build
Builds the JWK.- Returns:
- the JWK.
-
x509Thumbprint(String)
orx509ThumbprintS256(String)
instead.