Project

General

Profile

Actions

Task #3317

closed

Task #3289: Validator Refactoring

Design and Implement validator::CertificateCache

Added by Qiuhan Ding over 8 years ago. Updated over 7 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; 
};
Actions #1

Updated by Qiuhan Ding over 8 years ago

  • Assignee set to Qiuhan Ding
Actions #2

Updated by Qiuhan Ding over 8 years ago

  • Status changed from New to Code review
Actions #3

Updated by Qiuhan Ding over 8 years ago

  • % Done changed from 0 to 90
Actions #4

Updated by Qiuhan Ding over 8 years ago

  • Status changed from Code review to Closed
Actions #5

Updated by Qiuhan Ding over 8 years ago

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

Updated by Alex Afanasyev over 7 years ago

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

Also available in: Atom PDF