Yingdi Yu | 3715f8d | 2014-01-30 00:32:20 -0800 | [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 | * @author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 5 | * See COPYING for copyright and distribution information. |
| 6 | */ |
| 7 | |
| 8 | #ifndef NDN_SEC_RULE_SPECIFIC_H |
| 9 | #define NDN_SEC_RULE_SPECIFIC_H |
| 10 | |
| 11 | #include "sec-rule.hpp" |
| 12 | #include "../util/regex.hpp" |
| 13 | |
| 14 | namespace ndn{ |
| 15 | |
| 16 | class SecRuleSpecific : public ndn::SecRule |
| 17 | { |
| 18 | |
| 19 | public: |
| 20 | SecRuleSpecific(ndn::shared_ptr<ndn::Regex> dataRegex, |
| 21 | ndn::shared_ptr<ndn::Regex> signerRegex); |
| 22 | |
| 23 | SecRuleSpecific(const SecRuleSpecific& rule); |
| 24 | |
| 25 | virtual |
| 26 | ~SecRuleSpecific() {}; |
| 27 | |
| 28 | bool |
| 29 | matchDataName(const ndn::Data& data); |
| 30 | |
| 31 | bool |
| 32 | matchSignerName(const ndn::Data& data); |
| 33 | |
| 34 | bool |
| 35 | satisfy(const ndn::Data& data); |
| 36 | |
| 37 | bool |
| 38 | satisfy(const ndn::Name& dataName, const ndn::Name& signerName); |
| 39 | |
| 40 | private: |
| 41 | ndn::shared_ptr<ndn::Regex> m_dataRegex; |
| 42 | ndn::shared_ptr<ndn::Regex> m_signerRegex; |
| 43 | }; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | #endif |