37 const string& dataExpand,
const string& signerExpand,
40 m_dataRegex(dataRegex),
41 m_signerRegex(signerRegex),
43 m_dataExpand(dataExpand),
44 m_signerExpand(signerExpand),
45 m_dataNameRegex(dataRegex, dataExpand),
46 m_signerNameRegex(signerRegex, signerExpand)
48 if (op !=
">" && op !=
">=" && op !=
"==")
49 BOOST_THROW_EXCEPTION(
Error(
"op is wrong"));
70 return satisfy(dataName, signerName);
85 if (!m_dataNameRegex.
match(dataName))
87 Name expandDataName = m_dataNameRegex.
expand();
89 if (!m_signerNameRegex.
match(signerName))
91 Name expandSignerName = m_signerNameRegex.
expand();
93 bool matched = compare(expandDataName, expandSignerName);
117 return m_signerNameRegex.
match(signerName);
130 SecRuleRelative::compare(
const Name& dataName,
const Name& signerName)
132 if ((dataName == signerName) && (
"==" == m_op ||
">=" == m_op))
138 for (; i != dataName.
end() && j != signerName.
end(); i++, j++)
146 if (i == dataName.
end())
Copyright (c) 2011-2015 Regents of the University of California.
const_iterator end() const
End iterator (const).
const Name & getName() const
Get name of the Data packet.
const Name & getName() const
get Name element
indicates KeyLocator contains a Name
int compare(const Component &other) const
Compare this to the other Component using NDN canonical ordering.
bool hasKeyLocator() const
Check if SignatureInfo block has a KeyLocator.
virtual bool matchSignerName(const Data &data)
SecRuleRelative(const std::string &dataRegex, const std::string &signerRegex, const std::string &op, const std::string &dataExpand, const std::string &signerExpand, bool isPositive)
virtual ~SecRuleRelative()
Name abstraction to represent an absolute name.
const_iterator begin() const
Begin iterator (const).
virtual bool matchDataName(const Data &data)
virtual Name expand(const std::string &expand="")
virtual bool satisfy(const Data &data)
Component holds a read-only name component value.
bool match(const Name &name)
const Signature & getSignature() const
const KeyLocator & getKeyLocator() const
Get KeyLocator.
represents an error in TLV encoding or decoding