blob: f91e9e2b27cd620808f1718bede97dd6ba3e833e [file] [log] [blame]
akmhoque099495b2014-03-11 16:01:19 -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
9{
akmhoque5a44dd42014-03-12 18:11:32 -050010 class NlsrCertificateStoreEntry
11 {
12 public:
13 NlsrCertificateStoreEntry()
14 : cert(ndn::make_shared<ndn::IdentityCertificate>())
15 , certSeqNum(0)
16 , isSignerVerified(false)
17 {}
18
19 NlsrCertificateStoreEntry(ndn::shared_ptr<ndn::IdentityCertificate> pcert
20 , uint32_t csn, bool isv)
21 : cert(pcert)
22 , certSeqNum(csn)
23 , isSignerVerified(isv)
24 {}
25
26 ndn::shared_ptr<ndn::IdentityCertificate> getCert() const
akmhoque099495b2014-03-11 16:01:19 -050027 {
akmhoque5a44dd42014-03-12 18:11:32 -050028 return cert;
29 }
30
31 void setCert(ndn::shared_ptr<ndn::IdentityCertificate> pcert)
32 {
33 cert=pcert;
34 }
35
36 uint32_t getCertSeqNum() const
37 {
38 return certSeqNum;
39 }
40
41 void setCertSeqNum(uint32_t csn)
42 {
43 certSeqNum=csn;
44 }
45
46 bool getIsSignerVerified() const
47 {
48 return isSignerVerified;
49 }
50
51 void setIsSignerVerified(bool isv)
52 {
53 isSignerVerified=isv;
54 }
55
56 private:
57 ndn::shared_ptr<ndn::IdentityCertificate> cert;
58 uint32_t certSeqNum;
59 bool isSignerVerified;
60 };
61 /* Debugging Purpose */
62 std::ostream&
63 operator <<(std::ostream& os, const NlsrCertificateStoreEntry& ncse);
akmhoque099495b2014-03-11 16:01:19 -050064}
65
66#endif