Interface IApiKeyRegistry
Registry for managing API Keys
public interface IApiKeyRegistry
- Extension Methods
Methods
Deregister(string)
Deregisters the key with the specified tokenName
KeyToken? Deregister(string tokenName)
Parameters
tokenName
string
Returns
GenerateKey()
Generates a random, cryptographic API key
string GenerateKey()
Returns
Register(KeyToken, string)
Registers the key
for a given token
KeyToken Register(KeyToken token, string key)
Parameters
Returns
- KeyToken
The registered key token
RegisteredKeyCount()
Returns the total number of registered keys
int RegisteredKeyCount()
Returns
RegisteredKeys()
Returns an array of all currently registered key tokens, including keys that are expired but not deleted
KeyToken[] RegisteredKeys()
Returns
- KeyToken[]
VerifiedKey(string)
Key verification routine
KeyToken? VerifiedKey(string key)
Parameters
key
string
Returns
- KeyToken
The
associated with the key
if the key is valid, null otherwise