esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ndnph::isig::Policy< R0, R1, R2 > Class Template Reference

Validation policy for SigInfo fields in signed Interest. More...

#include <sig-info.hpp>

Public Member Functions

 Policy (const R0 &r0=R0(), const R1 &r1=R1(), const R2 &r2=R2())
 
bool create (Region &region, ISigInfo &si)
 Assign SigInfo extension fields. More...
 
bool check (const ISigInfo &si)
 Check that SigInfo fields fulfill current policy. More...
 

Detailed Description

template<typename R0, typename R1 = detail::Skip<11>, typename R2 = detail::Skip<12>>
class ndnph::isig::Policy< R0, R1, R2 >

Validation policy for SigInfo fields in signed Interest.

See also
makePolicy

The Policy instance internally keeps state. Therefore, each Policy instance can be used either for signing outgoing packets, or for verifying incoming packets signed by one public key. Separate Policy instances should be used for different public keys.

Constructor & Destructor Documentation

◆ Policy()

template<typename R0 , typename R1 = detail::Skip<11>, typename R2 = detail::Skip<12>>
ndnph::isig::Policy< R0, R1, R2 >::Policy ( const R0 &  r0 = R0(),
const R1 &  r1 = R1(),
const R2 &  r2 = R2() 
)
inlineexplicit

Member Function Documentation

◆ check()

template<typename R0 , typename R1 = detail::Skip<11>, typename R2 = detail::Skip<12>>
bool ndnph::isig::Policy< R0, R1, R2 >::check ( const ISigInfo si)
inline

Check that SigInfo fields fulfill current policy.

Returns
whether accepted.
Postcondition
If accepted, state within this Policy instance is updated.

◆ create()

template<typename R0 , typename R1 = detail::Skip<11>, typename R2 = detail::Skip<12>>
bool ndnph::isig::Policy< R0, R1, R2 >::create ( Region region,
ISigInfo si 
)
inline

Assign SigInfo extension fields.

Parameters
regionwhere to allocate memory for encoding extension fields.
siSigInfo to receive extension fields. Existing extensions will be overwritten.
Returns
whether success.
See also
Interest::sign(key, region, policy)

The documentation for this class was generated from the following file: