Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
| 11 | #ifndef LINKNDN_TRUSTED_CONTACT_H |
| 12 | #define LINKNDN_TRUSTED_CONTACT_H |
| 13 | |
| 14 | #include "contact-item.h" |
| 15 | #include <ndn.cxx/regex/regex.h> |
| 16 | |
Yingdi Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame] | 17 | class TrustedContact : public virtual ContactItem |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 18 | { |
| 19 | public: |
| 20 | TrustedContact(const EndorseCertificate& selfEndorseCertificate, |
| 21 | const std::string& trustScope, |
| 22 | const std::string& alias = std::string()); |
| 23 | |
Yingdi Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame] | 24 | TrustedContact(const ContactItem& contactItem); |
| 25 | |
| 26 | TrustedContact(const TrustedContact& trustedContact); |
| 27 | |
| 28 | virtual |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 29 | ~TrustedContact() {} |
| 30 | |
| 31 | void |
| 32 | addTrustScope(ndn::Ptr<ndn::Regex> nameSpace) |
| 33 | { m_trustScope.push_back(nameSpace); } |
| 34 | |
| 35 | bool |
| 36 | canBeTrustedFor(const ndn::Name& name); |
| 37 | |
| 38 | ndn::Ptr<ndn::Blob> |
| 39 | getTrustScopeBlob() const; |
| 40 | |
Yingdi Yu | a50c325 | 2013-11-03 15:05:26 -0800 | [diff] [blame] | 41 | inline const std::vector<ndn::Name>& |
| 42 | getTrustScopeList() const |
| 43 | { return m_trustScopeName; } |
| 44 | |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 45 | private: |
| 46 | std::vector<ndn::Ptr<ndn::Regex> > m_trustScope; |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 47 | std::vector<ndn::Name> m_trustScopeName; |
Yingdi Yu | ede8eaf | 2013-10-14 14:07:03 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | #endif |