cachePubKey method

  1. @visibleForTesting
void cachePubKey(
  1. String atSign,
  2. String enrollmentId,
  3. String pubKey
)
inherited

Implementation

@visibleForTesting
void cachePubKey(String atSign, String enrollmentId, String pubKey) {
  if (publicKeyCacheSettings == null) return;

  // Create a timer to auto purge the cache
  final timer = Timer(publicKeyCacheSettings!.cacheExpiry, () {
    pubKeyCache.remove(_cacheKey(atSign, enrollmentId));
  });
  pubKeyCache[_cacheKey(atSign, enrollmentId)] = (pubKey, timer);
}