Class PublishedJwk
RSA publication requires generic RSA key material with algorithm RSA and no key-level PSS parameters. RSASSA-PSS containers/restricted keys are outside this publication profile, even when a selected PSS signer can use them. Publication does not erase or reinterpret key restrictions.
Only the public key is required. The key identifier, algorithm and certificate chain are optional. No algorithm
is inferred when it is absent. Every key advertises use=sig.
Public parameters are copied when the builder starts, and certificate DER is copied and checked when its setter
is called. Neither the builder nor the built key retains caller-owned key or certificate objects. A certificate
chain supplies x5c, x5t and x5t#S256; certificate trust and validity periods are the
application's responsibility.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfigures an immutable published public key. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull PublishedJwkfromPublicKey(@NonNull PublicKey publicKey) Returns a public signing key without optional metadata; equivalent towithPublicKey(publicKey).build().Returns the optional JWKalgvalue.getKeyId()Returns the optional JWKkidvalue.toJson()Serializes this key's public JWK representation, including optional certificate metadata, to JSON text.Returns this key's immutable public JWK representation, including optional certificate metadata.toString()Describes this object without configured key identifiers, key parameters or certificate material.static @NonNull PublishedJwk.BuilderwithPublicKey(@NonNull PublicKey publicKey) Starts a builder with a checked snapshot of a public key.
-
Method Details
-
withPublicKey
@CheckReturnValue public static @NonNull PublishedJwk.Builder withPublicKey(@NonNull PublicKey publicKey) Starts a builder with a checked snapshot of a public key.- Parameters:
publicKey- the public signing key- Returns:
- the builder
- Throws:
NullPointerException- ifpublicKeyisnullIllegalArgumentException- if the key is unsupported, malformed or refused by Revetsec's key policy- Since:
- 1.0.0
-
fromPublicKey
Returns a public signing key without optional metadata; equivalent towithPublicKey(publicKey).build().- Parameters:
publicKey- the public signing key- Returns:
- the immutable published key
- Throws:
NullPointerException- ifpublicKeyisnullIllegalArgumentException- if the key is unsupported, malformed or refused by Revetsec's key policy- Since:
- 1.0.0
-
getKeyId
-
getAlgorithm
Returns the optional JWKalgvalue. No algorithm is inferred from the public key.- Returns:
- the configured algorithm, or empty
- Since:
- 1.0.0
-
toJson
-
toJsonObject
Returns this key's immutable public JWK representation, including optional certificate metadata.- Returns:
- the JWK; no private or symmetric key parameters are included
- Since:
- 1.0.0
-
toString
-