NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
signature.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #include "signature.hpp"
23 
24 namespace ndn {
25 
26 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Signature>));
27 static_assert(std::is_base_of<tlv::Error, Signature::Error>::value,
28  "Signature::Error must inherit from tlv::Error");
29 
30 Signature::Signature(const Block& info, const Block& value)
31  : m_info(info)
32  , m_value(value)
33 {
34 }
35 
36 
37 Signature::Signature(const SignatureInfo& info, const Block& value)
38  : m_info(info)
39  , m_value(value)
40 {
41 }
42 
43 void
45 {
46  m_info = SignatureInfo(info);
47 }
48 
49 void
51 {
52  if (value.type() != tlv::SignatureValue) {
53  BOOST_THROW_EXCEPTION(Error("The supplied block is not SignatureValue"));
54  }
55  m_value = value;
56 }
57 
58 } // namespace ndn
Copyright (c) 2011-2015 Regents of the University of California.
Signature()=default
void setInfo(const Block &info)
Set SignatureInfo from a block.
Definition: signature.cpp:44
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
void setValue(const Block &value)
Get SignatureValue from a block.
Definition: signature.cpp:50
SignatureInfo m_info
Definition: signature.hpp:175
uint32_t type() const
Definition: block.hpp:346