Project

General

Profile

Actions

Task #3292

closed

Task #3289: Validator Refactoring

Design and Implement TrustAnchorContainer

Added by Yingdi Yu about 9 years ago. Updated almost 8 years ago.

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

100%

Estimated time:

Description

TrustAnchorContainer is a member of validator::KeyManager, which manages pre-trusted keys.

There are two types of pre trusted keys: static which once loaded will stay in the container forever, and dynamic which will be refreshed every certain period.
Keys can be reloaded from a file path. When the path points to a file, a key will be loaded from the file; when the path points to a directory, all the keys under the directory will be loaded.

TrustAnchors can be searched by key name and interest, it can also be searched by group. Each group of dynamic keys are assigned an ID. For example, if all dynamic keys under a directory could be grouped together and share the same ID.

class TrustAnchorContainer
{
public:
  TrustAnchorContainer();

  ~TrustAnchorContainer();

  // @brief Insert static trust anchor from data packet.
  void
  insert(const shared_ptr<Data> idCert, const std::string& id = "");

  //@brief Insert dynamic trust anchor from path.
  void
  insert(const std::string& groupId, const std::string& certfilePath,
         const time::nanoseconds& refreshPeriod, bool isDir = false);

  // @brief Get certificate given key name
  shared_ptr<const Data>
  find(const Name& keyName);

  // @brief   Get certificate given interest
  shared_ptr<const Data>
  find(const Interest& interest);

  // @brief Get certificates under id
  const std::list<shared_ptr<const Data>>
  findById(const std::string& id);

private:
  // @brief Refresh anchors, triggered by find
  void
  refreshAnchors();

private:
  AnchorList m_anchors; // List of anchors indexed by name
  AnchorIndex m_anchorIndex; // Anchor index, indexed on id and expire time
};
Actions #1

Updated by Junxiao Shi about 9 years ago

Where can static keys be loaded from?

Actions #2

Updated by Qiuhan Ding about 9 years ago

  • Description updated (diff)
Actions #3

Updated by Qiuhan Ding about 9 years ago

  • Description updated (diff)
Actions #4

Updated by Qiuhan Ding about 9 years ago

  • Description updated (diff)
Actions #5

Updated by Yingdi Yu about 9 years ago

  • Status changed from New to Code review
  • % Done changed from 0 to 90
Actions #6

Updated by Qiuhan Ding about 9 years ago

  • Status changed from Code review to Closed
Actions #7

Updated by Qiuhan Ding about 9 years ago

  • Parent task changed from #3290 to #3289
Actions #8

Updated by Qiuhan Ding about 9 years ago

  • % Done changed from 90 to 100
Actions #9

Updated by Alex Afanasyev almost 8 years ago

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

Also available in: Atom PDF