| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| * Copyright (C) 2013 Regents of the University of California. |
| * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| * 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. |
| struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} }; |
| Signature(const Block &info, const Block &value) |
| info_.encode(); // will do nothing if wire already exists |
| setInfo(const Block &info) |
| if (info_.hasWire() || info_.hasValue()) |
| const Block &signatureType = info_.get(Tlv::SignatureType); |
| type_ = readNonNegativeInteger(signatureType); |
| value_.encode(); // will do nothing if wire already exists |
| setValue(const Block &value) |
| #endif // NDN_SIGNATURE_HPP |