10Duke Java Core
|
Built-in convenience implementation of JwtSignatureVerifierKeyProvider with support for loading JWKS from a URL.
Public Member Functions | |
void | initFromUrl (final String url) |
Loads JSON Web Key Set from the given URL. | |
PublicKey | provideDefault () |
Provides the default signature verification key. | |
PublicKey | provide (final String keyId) |
Provides a signature verification key by key id. | |
void | withDefaultKey (final String keyId, final PublicKey defaulKey) |
Stores a key by id and sets it as the default key. | |
void | addKey (final String keyId, final PublicKey key) |
Stores a key by id. | |
void | removeKey (final String keyId) |
Removes a key by id. | |
int | countKeys () |
Returns the count of keys currently held by this instance. | |
Map< String, PublicKey > | allKeys () |
Returns an unmodifiable view into all current keys. | |
boolean | supportsJwksUrlLoad () |
Returns flag that tells if this key provider supports loading token signing keys from a JWKS endpoint. | |
void | loadJwks (final URI jwksUrl) |
Request this key provider to load token signing keys from a JWKS endpoint. | |
![]() |
void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.addKey | ( | final String | keyId, |
final PublicKey | key ) |
Stores a key by id.
keyId | Identifier of the key to store. |
key | The key to store. |
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
Map< String, PublicKey > tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.allKeys | ( | ) |
Returns an unmodifiable view into all current keys.
Return value maps key id to each public key.
int tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.countKeys | ( | ) |
Returns the count of keys currently held by this instance.
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.initFromUrl | ( | final String | url | ) |
Loads JSON Web Key Set from the given URL.
The keys are stored in this instance into a map by key id. If the current default key is null then the first key in the JWKS response is set as the current default key.
url | The URL where the JWKS is available at. |
void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.loadJwks | ( | final URI | jwksUrl | ) |
Request this key provider to load token signing keys from a JWKS endpoint.
NOTE: use supportsJwksUrlLoad()
first to check that loading keys is supported.
jwksUrl | The JWKS endpoint to load public keys from. |
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
PublicKey tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.provide | ( | final String | keyId | ) |
Provides a signature verification key by key id.
keyId | The key id to lookup key with. |
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
PublicKey tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.provideDefault | ( | ) |
Provides the default signature verification key.
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.removeKey | ( | final String | keyId | ) |
Removes a key by id.
keyId | Identifier of the key to store. |
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
boolean tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.supportsJwksUrlLoad | ( | ) |
Returns flag that tells if this key provider supports loading token signing keys from a JWKS endpoint.
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.
void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.withDefaultKey | ( | final String | keyId, |
final PublicKey | key ) |
Stores a key by id and sets it as the default key.
keyId | Identifier of the key to store. |
key | The key to store. |
Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.