Actions
Task #3292
closedTask #3289: Validator Refactoring
Design and Implement TrustAnchorContainer
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
};
Updated by Yingdi Yu about 9 years ago
- Status changed from New to Code review
- % Done changed from 0 to 90
Updated by Qiuhan Ding almost 9 years ago
- Status changed from Code review to Closed
Updated by Qiuhan Ding almost 9 years ago
- Parent task changed from #3290 to #3289
Updated by Alex Afanasyev almost 8 years ago
- Assignee changed from Qiuhan Ding to Alex Afanasyev
- Target version set to v0.6
Actions