KeyService class

This service provides a centralized cache for public keys.

Keys for JWT validation are often fetched from JSON Web Key Sets (JWKS). Since key sets provide unique key-ids for every key, fetching the same key over and over is not necessary when validating keys from the same issuer.

You can disable the key cache by setting the datahub.enableKeyCache configuration value to false.

Inheritance

Constructors

KeyService()

Properties

configPath ConfigPath?
finalinherited
environment Environment
Fetch the environment configuration from ConfigService.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCache() → void
Clear all caches.
config<T>(String path) → T
Fetches a configuration value from ConfigService.
inherited
configObject<T extends TransferObjectBase>(String path, TransferBean<T> bean) → T
Fetches a configuration value from ConfigService and parse it into the TransferObject.
inherited
getJWKSKey(Uri jwksUri, String alg, String kid, {bool forceFetch = false}) Future<RSAPublicKey>
getOAuthKey(Uri issuer, String alg, String kid, {bool forceFetch = false}) Future<RSAPublicKey>
Fetches the OAuth public key with id kid from issuer.
initialize() Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shutdown() Future<void>
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited