10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider Interface Reference

Detailed Description

Service interface to implement for providing public keys for JWT signature verification.

Inheritance diagram for tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider:
tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider

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< JwksPersistentStoregetPersistentStore ()
 Gets the currently configured persistent store.
 
int loadFromPersistentStore ()
 Loads keys from the persistent store into the in-memory cache.
 

Member Function Documentation

◆ addKey()

void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.addKey ( String keyId,
PublicKey key )

Stores a key by id.

Parameters
keyIdIdentifier of the key to store.
keyThe key to store.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ countKeys()

int tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.countKeys ( )

Returns the count of keys currently held by this instance.

Returns
Current key count.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ getPersistentStore()

Optional< JwksPersistentStore > tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.getPersistentStore ( )

Gets the currently configured persistent store.

Returns
Optional containing the persistent store if configured, empty otherwise.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ loadFromPersistentStore()

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.

Returns
The number of keys loaded from persistent storage.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ loadJwks()

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.

Parameters
jwksUrlThe JWKS endpoint to load public keys from.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ provide()

PublicKey tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.provide ( String keyId)

Provides a signature verification key by key id.

Parameters
keyIdThe key id to lookup key with.
Returns
verification key, or null if not found by key id.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ provideDefault()

PublicKey tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.provideDefault ( )

Provides the default signature verification key.

Returns
default signature verification key, must not be null.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ removeKey()

void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.removeKey ( String keyId)

Removes a key by id.

Parameters
keyIdIdentifier of the key to store.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ setPersistentStore()

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.

Parameters
persistentStoreThe persistent store implementation to use.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ supportsJwksUrlLoad()

boolean tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.supportsJwksUrlLoad ( )

Returns flag that tells if this key provider supports loading token signing keys from a JWKS endpoint.

Returns
true if loading keys from JWKS endpoint is supported, false otherwise.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ supportsPersistentStorage()

boolean tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.supportsPersistentStorage ( )

Returns flag that tells if this key provider supports persistent storage of keys.

Returns
true if persistent storage is supported, false otherwise.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.

◆ withDefaultKey()

void tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.withDefaultKey ( String keyId,
PublicKey key )

Stores a key by id and sets it as the default key.

Parameters
keyIdIdentifier of the key to store.
keyThe key to store.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.


The documentation for this interface was generated from the following file: