Class SigningKeyJwkMapper
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.keys.SigningKeyJwkMapper
Maps the domain
SigningKey onto Nimbus JSON Web Keys: the public set lists the public half of every key it
is given, whereas the signing set holds the single active key with its private half, decrypted with the
AesGcmKeyCipher.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AesGcmKeyCipherDecrypts the private half of a key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.nimbusds.jose.jwk.JWKParses a JSON Web Key.com.nimbusds.jose.jwk.JWKSettoPublicJwkSet(List<SigningKey> keys) Builds the set of public keys.com.nimbusds.jose.jwk.JWKSettoSigningJwkSet(Optional<SigningKey> active) Builds the set holding the active key, with its private half.
-
Field Details
-
cipher
Decrypts the private half of a key.
-
-
Constructor Details
-
SigningKeyJwkMapper
public SigningKeyJwkMapper()
-
-
Method Details
-
toPublicJwkSet
Builds the set of public keys.- Parameters:
keys- the keys to publish.- Returns:
- the set, with the public half of each key only.
- Throws:
IllegalStateException- if a stored key is not a valid JWK.
-
toSigningJwkSet
Builds the set holding the active key, with its private half.- Parameters:
active- the active key, if any.- Returns:
- the set; empty before the first rotation has created an active key.
- Throws:
IllegalStateException- if the stored key is not a valid JWK.
-
toJwk
Parses a JSON Web Key.- Parameters:
json- the key as JSON.- Returns:
- the key.
- Throws:
IllegalStateException- if the text is not a valid key.
-