NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
interest-signer.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2021 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_CXX_SECURITY_INTEREST_SIGNER_HPP
23
#define NDN_CXX_SECURITY_INTEREST_SIGNER_HPP
24
25
#include "
ndn-cxx/security/key-chain.hpp
"
26
27
namespace
ndn
{
28
namespace
security
{
29
35
class
InterestSigner
36
{
37
public
:
43
enum
SigningFlags
: uint32_t {
44
WantNonce
= 1 << 0,
45
WantTime
= 1 << 1,
46
WantSeqNum
= 1 << 2,
47
};
48
49
public
:
50
explicit
51
InterestSigner
(
KeyChain
& keyChain);
52
62
void
63
makeSignedInterest
(
Interest
& interest,
64
SigningInfo
params =
SigningInfo
(),
65
uint32_t signingFlags =
WantNonce
|
WantTime
);
66
74
Interest
75
makeCommandInterest
(
Name
name
,
const
SigningInfo
& params =
SigningInfo
());
76
77
private
:
81
time::system_clock::TimePoint
82
getFreshTimestamp();
83
84
private
:
85
KeyChain
& m_keyChain;
86
time::system_clock::TimePoint
m_lastUsedTimestamp;
87
uint64_t m_lastUsedSeqNum;
88
};
89
90
}
// namespace security
91
}
// namespace ndn
92
93
#endif // NDN_CXX_SECURITY_INTEREST_SIGNER_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::KeyChain
ndn security KeyChain
Definition:
key-chain.cpp:70
ndn::security::InterestSigner::makeCommandInterest
Interest makeCommandInterest(Name name, const SigningInfo ¶ms=SigningInfo())
Creates and signs a command Interest.
Definition:
interest-signer.cpp:63
key-chain.hpp
ndn::security::InterestSigner::WantSeqNum
Definition:
interest-signer.hpp:46
ndn::security::InterestSigner::InterestSigner
InterestSigner(KeyChain &keyChain)
Definition:
interest-signer.cpp:28
ndn::Interest
Represents an Interest packet.
Definition:
interest.hpp:48
ndn::security::SigningInfo
Signing parameters passed to KeyChain.
Definition:
signing-info.hpp:52
ndn::security::InterestSigner
Helper class to create signed Interests.
Definition:
interest-signer.hpp:35
ndn::security::InterestSigner::WantTime
Definition:
interest-signer.hpp:45
ndn::security::InterestSigner::WantNonce
Definition:
interest-signer.hpp:44
ndn::security::InterestSigner::SigningFlags
SigningFlags
Flags to indicate which elements to include in Interest signatures created with makeSignedInterest.
Definition:
interest-signer.hpp:43
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::security
Definition:
dummy-keychain.cpp:28
ndn::security::InterestSigner::makeSignedInterest
void makeSignedInterest(Interest &interest, SigningInfo params=SigningInfo(), uint32_t signingFlags=WantNonce|WantTime)
Signs an Interest (following Packet Specification v0.3 or newer)
Definition:
interest-signer.cpp:35
ndn::name
Definition:
name-component-types.hpp:33
ndn::time::system_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:203
ndnSIM
ndn-cxx
ndn-cxx
security
interest-signer.hpp
Generated on Fri May 6 2022 12:34:12 for ndnSIM by
1.8.13