blob: 1257129d631674e5be7d1e263936e19656a38664 [file] [log] [blame]
akmhoque53353462014-04-22 08:43:45 -05001#ifndef NLSR_CERT_STORE_ENTRY_HPP
2#define NLSR_CERT_STORE_ENTRY_HPP
3
4#include <iostream>
5#include <ndn-cpp-dev/face.hpp>
6#include <ndn-cpp-dev/security/identity-certificate.hpp>
7
8namespace nlsr {
9class CertificateStoreEntry
10{
11public:
12 CertificateStoreEntry()
13 : m_cert(ndn::make_shared<ndn::IdentityCertificate>())
14 , m_certSeqNum(0)
15 , m_isSignerVerified(false)
16 {}
17
18 CertificateStoreEntry(ndn::shared_ptr<ndn::IdentityCertificate> pcert
19 , uint32_t csn, bool isv)
20 : m_cert(pcert)
21 , m_certSeqNum(csn)
22 , m_isSignerVerified(isv)
23 {}
24
25 ndn::shared_ptr<ndn::IdentityCertificate>
26 getCert() const
27 {
28 return m_cert;
29 }
30
31 void
32 setCert(ndn::shared_ptr<ndn::IdentityCertificate> pcert)
33 {
34 m_cert = pcert;
35 }
36
37 uint32_t
38 getCertSeqNum() const
39 {
40 return m_certSeqNum;
41 }
42
43 void
44 setCertSeqNum(uint32_t csn)
45 {
46 m_certSeqNum = csn;
47 }
48
49 bool
50 getIsSignerVerified() const
51 {
52 return m_isSignerVerified;
53 }
54
55 void
56 setIsSignerVerified(bool isv)
57 {
58 m_isSignerVerified = isv;
59 }
60
61private:
62 ndn::shared_ptr<ndn::IdentityCertificate> m_cert;
63 uint32_t m_certSeqNum;
64 bool m_isSignerVerified;
65};
66/* Debugging Purpose */
67std::ostream&
68operator <<(std::ostream& os, const CertificateStoreEntry& ncse);
69
70}//namespace NLSR
71
72#endif //NLSR_CERT_STORE_ENTRY_HPP