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