blob: b080dbba18cc13d8d7b76647e99ccd329440b970 [file] [log] [blame]
Yingdi Yuede8eaf2013-10-14 14:07:03 -07001/* -*- 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 Yua50c3252013-11-03 15:05:26 -080017class TrustedContact : public virtual ContactItem
Yingdi Yuede8eaf2013-10-14 14:07:03 -070018{
19public:
20 TrustedContact(const EndorseCertificate& selfEndorseCertificate,
21 const std::string& trustScope,
22 const std::string& alias = std::string());
23
Yingdi Yua50c3252013-11-03 15:05:26 -080024 TrustedContact(const ContactItem& contactItem);
25
26 TrustedContact(const TrustedContact& trustedContact);
27
28 virtual
Yingdi Yuede8eaf2013-10-14 14:07:03 -070029 ~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 Yua50c3252013-11-03 15:05:26 -080041 inline const std::vector<ndn::Name>&
42 getTrustScopeList() const
43 { return m_trustScopeName; }
44
Yingdi Yuede8eaf2013-10-14 14:07:03 -070045private:
46 std::vector<ndn::Ptr<ndn::Regex> > m_trustScope;
Yingdi Yu42f66462013-10-31 17:38:22 -070047 std::vector<ndn::Name> m_trustScopeName;
Yingdi Yuede8eaf2013-10-14 14:07:03 -070048};
49
50#endif