23 #include "../util/random.hpp"
29 : m_lastUsedTimestamp(0)
37 if (timestamp <= m_lastUsedTimestamp) {
38 timestamp = m_lastUsedTimestamp + time::milliseconds(1);
40 m_lastUsedTimestamp = timestamp;
51 : m_keyChain(keyChain)
59 m_keyChain.
sign(commandInterest, params);
60 return commandInterest;
static Component fromNumber(uint64_t number)
Create a component encoded as nonNegativeInteger.
Copyright (c) 2013-2016 Regents of the University of California.
The interface of signing key management.
Interest makeCommandInterest(const Name &name, const SigningInfo ¶ms=v2::KeyChain::getDefaultSigningInfo())
Create CommandInterest.
represents an Interest packet
Name prepareCommandInterestName(Name name)
Prepare name of the CommandInterest.
static time_point now() noexcept
Signing parameters passed to KeyChain.
CommandInterestPreparer()
Name abstraction to represent an absolute name.
void sign(Data &data, const SigningInfo ¶ms=getDefaultSigningInfo())
Sign data according to the supplied signing information.
uint64_t generateWord64()
Generate a non-cryptographically-secure random integer in the range [0, 2^64)
milliseconds toUnixTimestamp(const system_clock::TimePoint &point)
Convert system_clock::TimePoint to UNIX timestamp.
Name & append(const uint8_t *value, size_t valueLength)
Append a new component, copying from value of length valueLength.
CommandInterestSigner(v2::KeyChain &keyChain)