akmhoque | 099495b | 2014-03-11 16:01:19 -0500 | [diff] [blame] | 1 | #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 | |
| 8 | namespace nlsr |
| 9 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 10 | 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 |
akmhoque | 099495b | 2014-03-11 16:01:19 -0500 | [diff] [blame] | 27 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 28 | 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); |
akmhoque | 099495b | 2014-03-11 16:01:19 -0500 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | #endif |