certificate-storage.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_V2_CERTIFICATE_STORAGE_HPP
23 #define NDN_SECURITY_V2_CERTIFICATE_STORAGE_HPP
24 
25 #include "certificate.hpp"
26 #include "certificate-cache.hpp"
28 
29 namespace ndn {
30 namespace security {
31 namespace v2 {
32 
36 class CertificateStorage : noncopyable
37 {
38 public:
40 
48  const Certificate*
49  findTrustedCert(const Interest& interestForCert) const;
50 
55  bool
56  isCertKnown(const Name& certPrefix) const;
57 
64  void
66 
71  getTrustAnchors() const;
72 
76  const CertificateCache&
77  getVerifiedCertCache() const;
78 
82  const CertificateCache&
83  getUnverifiedCertCache() const;
84 
85 protected:
94  void
95  loadAnchor(const std::string& groupId, Certificate&& cert);
96 
108  void
109  loadAnchor(const std::string& groupId, const std::string& certfilePath,
110  time::nanoseconds refreshPeriod, bool isDir = false);
111 
118  void
120 
121 protected:
125 };
126 
127 } // namespace v2
128 } // namespace security
129 } // namespace ndn
130 
131 #endif // NDN_SECURITY_V2_CERTIFICATE_STORAGE_HPP
const CertificateCache & getVerifiedCertCache() const
void loadAnchor(const std::string &groupId, Certificate &&cert)
load static trust anchor.
Copyright (c) 2013-2016 Regents of the University of California.
Definition: common.hpp:74
The certificate following the certificate format naming convention.
const TrustAnchorContainer & getTrustAnchors() const
void cacheUnverifiedCert(Certificate &&cert)
Cache unverified certificate for a period of time (5 minutes)
represents an Interest packet
Definition: interest.hpp:42
bool isCertKnown(const Name &certPrefix) const
Check if certificate exists in verified, unverified cache, or in the set of trust anchors...
Represents a container for verified certificates.
represents a container for trust anchors.
const CertificateCache & getUnverifiedCertCache() const
Storage for trusted anchors, verified certificate cache, and unverified certificate cache...
void cacheVerifiedCert(Certificate &&cert)
Cache verified certificate a period of time (1 hour)
const Certificate * findTrustedCert(const Interest &interestForCert) const
Find a trusted certificate in trust anchor container or in verified cache.
Name abstraction to represent an absolute name.
Definition: name.hpp:46