| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| * Copyright (C) 2013-2014 Regents of the University of California. |
| * See COPYING for copyright and distribution information. |
| #ifndef NDN_SIGNATURE_HPP |
| #define NDN_SIGNATURE_HPP |
| * A Signature is storage for the signature-related information (info and value) in a Data packet. |
| class Error : public Tlv::Error |
| Error(const std::string& what) |
| Signature(const Block& info, const Block& value = Block()) |
| m_info.encode(); // will do nothing if wire already exists |
| setInfo(const Block& info) |
| if (m_info.hasWire() || m_info.hasValue()) |
| const Block& signatureType = m_info.get(Tlv::SignatureType); |
| m_type = readNonNegativeInteger(signatureType); |
| m_value.encode(); // will do nothing if wire already exists |
| setValue(const Block& value) |
| public: // EqualityComparable concept |
| operator==(const Signature& other) const |
| return getInfo() == other.getInfo() && |
| getValue() == other.getValue(); |
| operator!=(const Signature& other) const |
| return !(*this == other); |
| #endif // NDN_SIGNATURE_HPP |