Project

General

Profile

Task #3317

Task #3289: Validator Refactoring

Design and Implement validator::CertificateCache

Added by Qiuhan Ding almost 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Security
Target version:
Start date:
11/04/2015
Due date:
% Done:

100%

Estimated time:

Description

One Module of KeyManager which manages verified certificates for Validator.

The certificates inside the cache would have an expire time and there is a maximum life time for all certificates.

Certificates can be searched by key name and interest

const time::nanoseconds DEFAULT_LIFE_TIME(time::seconds(3600));

class CertificateCache
{
public:
  // @brief Create an object for certificate cache.
  explicit
  CertificateCache(const time::nanoseconds& lifeTime = DEFAULT_LIFE_TIME);

  ~CertificateCache();

  // @brief Insert certificate into cache.
  void
  insert(shared_ptr<const Data> cert, const time::system_clock::TimePoint& expireTime);

  // @brief Get certificate given key name. The method will also remove outdated certificate entries.
  shared_ptr<const Data>
  find(const Name& keyName);

  // @brief Find certificate given interest. The method will also remove outdated certificate entries.
  shared_ptr<const Data>
  find(const Interest& interest);

private:
  // @brief Remove all outdated certificate entries.
  void
  refresh();

private:
  CertIndex m_certs;
  time::nanoseconds m_lifeTime; 
};
#1

Updated by Qiuhan Ding almost 5 years ago

  • Assignee set to Qiuhan Ding
#2

Updated by Qiuhan Ding almost 5 years ago

  • Status changed from New to Code review
#3

Updated by Qiuhan Ding almost 5 years ago

  • % Done changed from 0 to 90
#4

Updated by Qiuhan Ding almost 5 years ago

  • Status changed from Code review to Closed
#5

Updated by Qiuhan Ding almost 5 years ago

  • % Done changed from 90 to 100
  • Parent task changed from #3290 to #3289
#6

Updated by Alex Afanasyev over 3 years ago

  • Category set to Security
  • Assignee changed from Qiuhan Ding to Alex Afanasyev
  • Target version set to v0.6

Also available in: Atom PDF