blob: 2b7b355f17c23d91fd02976b3cad7977c78ef029 [file] [log] [blame]
Yingdi Yu3715f8d2014-01-30 00:32:20 -08001/* -*- 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
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080011#include "../common.hpp"
Yingdi Yu3715f8d2014-01-30 00:32:20 -080012#include "sec-rule.hpp"
13#include "../util/regex.hpp"
14
15namespace ndn{
16
17class SecRuleSpecific : public ndn::SecRule
18{
19
20public:
21 SecRuleSpecific(ndn::shared_ptr<ndn::Regex> dataRegex,
22 ndn::shared_ptr<ndn::Regex> signerRegex);
23
24 SecRuleSpecific(const SecRuleSpecific& rule);
25
26 virtual
27 ~SecRuleSpecific() {};
28
29 bool
30 matchDataName(const ndn::Data& data);
31
32 bool
33 matchSignerName(const ndn::Data& data);
34
35 bool
36 satisfy(const ndn::Data& data);
37
38 bool
39 satisfy(const ndn::Name& dataName, const ndn::Name& signerName);
40
41private:
42 ndn::shared_ptr<ndn::Regex> m_dataRegex;
43 ndn::shared_ptr<ndn::Regex> m_signerRegex;
44};
45
46}
47
48#endif