blob: 238d5118951732be62c60d4a20bf73eafffc31a3 [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()
akmhoque05d5fcf2014-04-15 14:58:45 -050014 : m_cert(ndn::make_shared<ndn::IdentityCertificate>())
15 , m_certSeqNum(0)
16 , m_isSignerVerified(false)
akmhoque5a44dd42014-03-12 18:11:32 -050017 {}
18
19 NlsrCertificateStoreEntry(ndn::shared_ptr<ndn::IdentityCertificate> pcert
20 , uint32_t csn, bool isv)
akmhoque05d5fcf2014-04-15 14:58:45 -050021 : m_cert(pcert)
22 , m_certSeqNum(csn)
23 , m_isSignerVerified(isv)
akmhoque5a44dd42014-03-12 18:11:32 -050024 {}
25
26 ndn::shared_ptr<ndn::IdentityCertificate> getCert() const
akmhoque099495b2014-03-11 16:01:19 -050027 {
akmhoque05d5fcf2014-04-15 14:58:45 -050028 return m_cert;
akmhoque5a44dd42014-03-12 18:11:32 -050029 }
30
31 void setCert(ndn::shared_ptr<ndn::IdentityCertificate> pcert)
32 {
akmhoque05d5fcf2014-04-15 14:58:45 -050033 m_cert=pcert;
akmhoque5a44dd42014-03-12 18:11:32 -050034 }
35
36 uint32_t getCertSeqNum() const
37 {
akmhoque05d5fcf2014-04-15 14:58:45 -050038 return m_certSeqNum;
akmhoque5a44dd42014-03-12 18:11:32 -050039 }
40
41 void setCertSeqNum(uint32_t csn)
42 {
akmhoque05d5fcf2014-04-15 14:58:45 -050043 m_certSeqNum=csn;
akmhoque5a44dd42014-03-12 18:11:32 -050044 }
45
46 bool getIsSignerVerified() const
47 {
akmhoque05d5fcf2014-04-15 14:58:45 -050048 return m_isSignerVerified;
akmhoque5a44dd42014-03-12 18:11:32 -050049 }
50
51 void setIsSignerVerified(bool isv)
52 {
akmhoque05d5fcf2014-04-15 14:58:45 -050053 m_isSignerVerified=isv;
akmhoque5a44dd42014-03-12 18:11:32 -050054 }
55
56 private:
akmhoque05d5fcf2014-04-15 14:58:45 -050057 ndn::shared_ptr<ndn::IdentityCertificate> m_cert;
58 uint32_t m_certSeqNum;
59 bool m_isSignerVerified;
akmhoque5a44dd42014-03-12 18:11:32 -050060 };
61 /* Debugging Purpose */
62 std::ostream&
63 operator <<(std::ostream& os, const NlsrCertificateStoreEntry& ncse);
akmhoque099495b2014-03-11 16:01:19 -050064}
65
66#endif