Class CryptoKeyCache
- Namespace
- Lextm.SharpSnmpLib.Security
- Assembly
- SharpSnmpLib.dll
Class for holding computed crypto values which are referenced by password/engineId combination This class is not thread safe, it does not contain any static parameters.
public class CryptoKeyCache
- Inheritance
-
CryptoKeyCache
- Inherited Members
Constructors
CryptoKeyCache(int)
Ctor
public CryptoKeyCache(int capacity)
Parameters
capacity
int
Methods
AddValueToCache(byte[], byte[], byte[])
Adds computed value to the cache
public void AddValueToCache(byte[] password, byte[] engineId, byte[] valueToCache)
Parameters
password
byte[]password to associate cached value with
engineId
byte[]engine id to associate cached value with
valueToCache
byte[]value being cached
TryGetCachedValue(byte[], byte[], out byte[]?)
Get the cached value if it exists in the cache
public bool TryGetCachedValue(byte[] password, byte[] engineId, out byte[]? cachedValue)
Parameters
password
byte[]password associated with cached value
engineId
byte[]engine id associated with cached value
cachedValue
byte[]cached value, if no cache exists for specified password/engine id combination default value is assigned to cachedValue
Returns
- bool
True if value exists in cache for specified password/engine id combination, false otherwise