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 | |
| 17 | class TrustedContact : public ContactItem |
| 18 | { |
| 19 | public: |
| 20 | TrustedContact(const EndorseCertificate& selfEndorseCertificate, |
| 21 | const std::string& trustScope, |
| 22 | const std::string& alias = std::string()); |
| 23 | |
| 24 | ~TrustedContact() {} |
| 25 | |
| 26 | void |
| 27 | addTrustScope(ndn::Ptr<ndn::Regex> nameSpace) |
| 28 | { m_trustScope.push_back(nameSpace); } |
| 29 | |
| 30 | bool |
| 31 | canBeTrustedFor(const ndn::Name& name); |
| 32 | |
| 33 | ndn::Ptr<ndn::Blob> |
| 34 | getTrustScopeBlob() const; |
| 35 | |
| 36 | private: |
| 37 | std::vector<ndn::Ptr<ndn::Regex> > m_trustScope; |
| 38 | }; |
| 39 | |
| 40 | #endif |