10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider Class Reference

Detailed Description

Built-in convenience implementation of JwtSignatureVerifierKeyProvider with support for loading JWKS from a URL.

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

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.
 
- Public Member Functions inherited from tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider

Member Function Documentation

◆ addKey()

void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.addKey ( final String keyId,
final PublicKey key )

Stores a key by id.

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

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ allKeys()

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.

Returns
Map with key id's and public keys.

◆ countKeys()

int tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.countKeys ( )

Returns the count of keys currently held by this instance.

Returns
Current key count.

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ initFromUrl()

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.

Parameters
urlThe URL where the JWKS is available at.

◆ loadJwks()

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.

Parameters
jwksUrlThe JWKS endpoint to load public keys from.

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ provide()

PublicKey tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.provide ( final 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.

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ provideDefault()

PublicKey tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.provideDefault ( )

Provides the default signature verification key.

Returns
default signature verification key, must not be null.

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ removeKey()

void tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider.removeKey ( final String keyId)

Removes a key by id.

Parameters
keyIdIdentifier of the key to store.

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ supportsJwksUrlLoad()

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.

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

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.

◆ withDefaultKey()

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.

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

Implements tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider.


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