Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​IdentityModel.​Tokens.​InMemoryCryptoProviderCache
Assembly: Microsoft.IdentityModel.Tokens
Inheritance: object → CryptoProviderCache → InMemoryCryptoProviderCache
Implemented Interfaces
Defines a cache for crypto providers. Current support is limited to <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> only.
Methods
protected
string
GetCacheKey​(SignatureProvider signatureProvider)
Returns the cache key to use when looking up an entry into the cache for a <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" />
Returns the cache key to use for finding a <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> .
signatureProvider
the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> to create the key for.
protected
string
GetCacheKey​(SecurityKey securityKey,
string algorithm,
string typeofProvider)
Returns the 'key' that will be used to find a crypto provider in this cache.
Returns the cache key to use for finding a crypto provider.
securityKey
the key that is used to by the crypto provider.
algorithm
the algorithm that is used by the crypto provider.
typeofProvider
the typeof the crypto provider obtained by calling object.GetType().
public
bool
TryAdd​(SignatureProvider signatureProvider)
Trys to adds a <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> to this cache.
Returns <c>true</c> if the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> was added, <c>false</c> if the cache already contained the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> or if <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> should not be cached.
signatureProvider
<see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> to cache.
Remarks
if the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> is added <see cref="P:Microsoft.IdentityModel.Tokens.SignatureProvider.CryptoProviderCache" /> will be set to 'this'.
public
bool
TryGetSignatureProvider​(SecurityKey securityKey,
string algorithm,
string typeofProvider,
bool willCreateSignatures,
SignatureProvider& signatureProvider)
public
bool
TryRemove​(SignatureProvider signatureProvider)
Trys to remove a <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> from this cache.
Returns true if the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> was removed, false if the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> was not found.
signatureProvider
<see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> to remove.
Remarks
if the <see cref="T:Microsoft.IdentityModel.Tokens.SignatureProvider" /> is removed <see cref="P:Microsoft.IdentityModel.Tokens.SignatureProvider.CryptoProviderCache" /> will be set to null.
public
void
Dispose​()
Calls <see cref="M:Microsoft.IdentityModel.Tokens.InMemoryCryptoProviderCache.Dispose(System.Boolean)" /> and <see cref="M:System.GC.SuppressFinalize(System.Object)" />
Note: the EventBasedLRUCache is no longer being disposed of, but since this is a public class and can be used as base class of
custom cache implementations, we need to keep it as some implementations may override Dispose().
protected
void
Dispose​(bool disposing)
If <paramref name="disposing" /> is true, this method disposes of <see cref="F:Microsoft.IdentityModel.Tokens.InMemoryCryptoProviderCache._signingSignatureProviders" /> and <see cref="F:Microsoft.IdentityModel.Tokens.InMemoryCryptoProviderCache._verifyingSignatureProviders" /> .
disposing
True if called from the <see cref="M:Microsoft.IdentityModel.Tokens.InMemoryCryptoProviderCache.Dispose" /> method, false otherwise.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object