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
44
Signature::setInfo
(
const
Block
& info)
45
{
46
m_info
=
SignatureInfo
(info);
47
}
48
49
void
50
Signature::setValue
(
const
Block
& value)
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
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::Signature::Signature
Signature()=default
ndn::SignatureInfo
Definition:
signature-info.hpp:32
ndn::Signature::setInfo
void setInfo(const Block &info)
Set SignatureInfo from a block.
Definition:
signature.cpp:44
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
signature.hpp
ndn::Signature::setValue
void setValue(const Block &value)
Get SignatureValue from a block.
Definition:
signature.cpp:50
ndn::tlv::SignatureValue
Definition:
tlv.hpp:80
ndn::tlv::SignatureInfo
Definition:
tlv.hpp:79
ndn::Signature::Error
Definition:
signature.hpp:36
ndn::Signature::m_info
SignatureInfo m_info
Definition:
signature.hpp:175
ndn::Signature::m_value
Block m_value
Definition:
signature.hpp:176
ndn::Block::type
uint32_t type() const
Definition:
block.hpp:346
ndnSIM
ndn-cxx
src
signature.cpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12