Interest packet.
More...
#include <interest.hpp>
Inherits ndnph::Printable, and ndnph::detail::InterestRefBase.
◆ Signed
Result of Interest::sign operation.
◆ checkDigest()
bool ndnph::Interest::checkDigest |
( |
| ) |
const |
|
inline |
Check ParametersSha256DigestComponent.
- Returns
- whether the digest is correct.
This method only works on decoded packet. It's unnecessary to call this method if you are going to use verify().
◆ decodeFrom() [1/2]
bool ndnph::Interest::decodeFrom |
( |
const Decoder::Tlv & |
input | ) |
|
|
inline |
◆ decodeFrom() [2/2]
template<typename Encodable >
bool ndnph::Interest::decodeFrom |
( |
Encodable && |
encodable | ) |
|
|
inline |
Encode then decode as Interest packet.
This is useful for obtaining an Interest packet in decoded state from the result of signing.
◆ encodeTo()
void ndnph::Interest::encodeTo |
( |
Encoder & |
encoder | ) |
const |
|
inline |
Encode the Interest without AppParameters.
◆ getAppParameters()
tlv::Value ndnph::Interest::getAppParameters |
( |
| ) |
const |
|
inline |
Retrieve AppParameters.
- Precondition
- only available on decoded packet.
- Note
- To create Interest packet with AppParameters, use parameterize().
◆ getSigInfo()
const ISigInfo* ndnph::Interest::getSigInfo |
( |
| ) |
const |
|
inline |
Retrieve SignatureInfo.
- Precondition
- only available on decoded packet.
◆ match()
template<typename DataT >
bool ndnph::Interest::match |
( |
const DataT & |
data | ) |
const |
|
inline |
◆ parameterize()
Add AppParameters to the packet.
- Precondition
- Name contains zero or one ParametersSha256DigestComponent.
- Returns
- an Encodable object, with an additional `sign(const PrivateKey&)` method to create a signed Interest. This object is valid only if Interest and appParameters are kept alive. It's recommended to pass it to Encoder immediately without saving as variable.
- Note
- Unrecognized fields found during decoding are not preserved in encoding output.
-
This method does not set sigValue. Packet is not verifiable after this operation.
◆ printTo()
size_t ndnph::Interest::printTo |
( |
::Print & |
p | ) |
const |
|
inlinefinalvirtual |
◆ setCanBePrefix()
void ndnph::Interest::setCanBePrefix |
( |
bool |
v | ) |
|
|
inline |
◆ setFwHint()
void ndnph::Interest::setFwHint |
( |
const Name & |
v | ) |
|
|
inline |
◆ setHopLimit()
void ndnph::Interest::setHopLimit |
( |
uint8_t |
v | ) |
|
|
inline |
◆ setLifetime()
void ndnph::Interest::setLifetime |
( |
uint16_t |
v | ) |
|
|
inline |
◆ setMustBeFresh()
void ndnph::Interest::setMustBeFresh |
( |
bool |
v | ) |
|
|
inline |
◆ setName()
void ndnph::Interest::setName |
( |
const Name & |
v | ) |
|
|
inline |
◆ setNonce()
void ndnph::Interest::setNonce |
( |
uint32_t |
v | ) |
|
|
inline |
◆ sign()
template<typename... Arg>
Signed ndnph::Interest::sign |
( |
Arg &&... |
arg | ) |
const |
|
inline |
Sign the packet with a private key.
- Precondition
- If Name contains ParametersSha256DigestComponent, it is the last component.
- Returns
- an Encodable object. This object is valid only if Interest and PrivateKey are kept alive. It's recommended to pass it to Encoder immediately without saving as variable.
- Note
- Unrecognized fields found during decoding are not preserved in encoding output.
-
This method does not set sigValue. Packet is not verifiable after this operation.
To create a signed Interest with AppParameters, call parameterize() first, then call sign() on its return value.
◆ verify()
bool ndnph::Interest::verify |
( |
const PublicKey & |
key | ) |
const |
|
inline |
Verify the packet with a public key.
- Returns
- verification result.
This method only works on decoded packet. It does not work on packet that has been modified or (re-)signed.
The documentation for this class was generated from the following file:
- /home/runner/work/esp8266ndn/NDNph/src/ndnph/packet/interest.hpp