|
10Duke Java Core
|
Service interface to implement for providing public keys for JWT signature verification.
Public Member Functions | |
| PublicKey | provideDefault () |
| Provides the default signature verification key. | |
| PublicKey | provide (String keyId) |
| Provides a signature verification key by key id. | |
| void | withDefaultKey (String keyId, PublicKey key) |
| Stores a key by id and sets it as the default key. | |
| void | addKey (String keyId, PublicKey key) |
| Stores a key by id. | |
| void | removeKey (String keyId) |
| Removes a key by id. | |
| int | countKeys () |
| Returns the count of keys currently held by this instance. | |
| boolean | supportsJwksUrlLoad () |
| Returns flag that tells if this key provider supports loading token signing keys from a JWKS endpoint. | |
| void | loadJwks (URI jwksUrl) |
| Request this key provider to load token signing keys from a JWKS endpoint. | |
| boolean | supportsPersistentStorage () |
| Returns flag that tells if this key provider supports persistent storage of keys. | |
| void | setPersistentStore (JwksPersistentStore persistentStore) |
| Sets the persistent store to use for caching keys. | |
| Optional< JwksPersistentStore > | getPersistentStore () |
| Gets the currently configured persistent store. | |
| int | loadFromPersistentStore () |
| Loads keys from the persistent store into the in-memory cache. | |
| void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.addKey | ( | String | keyId, |
| PublicKey | key ) |
Stores a key by id.
| keyId | Identifier of the key to store. |
| key | The key to store. |
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| int tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.countKeys | ( | ) |
Returns the count of keys currently held by this instance.
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| Optional< JwksPersistentStore > tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.getPersistentStore | ( | ) |
Gets the currently configured persistent store.
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| int tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.loadFromPersistentStore | ( | ) |
Loads keys from the persistent store into the in-memory cache.
This method should be called during initialization to restore previously persisted keys.
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.loadJwks | ( | 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. |
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| PublicKey tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.provide | ( | String | keyId | ) |
Provides a signature verification key by key id.
| keyId | The key id to lookup key with. |
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| PublicKey tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.provideDefault | ( | ) |
Provides the default signature verification key.
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.removeKey | ( | String | keyId | ) |
Removes a key by id.
| keyId | Identifier of the key to store. |
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.setPersistentStore | ( | JwksPersistentStore | persistentStore | ) |
Sets the persistent store to use for caching keys.
This method allows injection of a persistent storage implementation that will be used to persist keys across application restarts.
| persistentStore | The persistent store implementation to use. |
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| boolean tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.supportsJwksUrlLoad | ( | ) |
Returns flag that tells if this key provider supports loading token signing keys from a JWKS endpoint.
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| boolean tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.supportsPersistentStorage | ( | ) |
Returns flag that tells if this key provider supports persistent storage of keys.
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.
| void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.withDefaultKey | ( | String | keyId, |
| 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. |
Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.