esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Functions
ndnph::ec Namespace Reference

Namespaces

 detail
 

Classes

class  EcPublicKey
 EC public key. More...
 
class  EcPrivateKey
 EC private key. More...
 

Functions

bool generateRaw (uint8_t pvt[EcPrivateKey::KeyLen::value], uint8_t pub[EcPublicKey::KeyLen::value])
 Generate key pair in raw format. More...
 
bool generate (Region &region, const Name &name, EcPrivateKey &pvt, EcPublicKey &pub)
 Generate key pair. More...
 
bool generate (Region &region, const Name &name, EcPrivateKey &pvt, EcPublicKey &pub, KeyChain &keyChain, const char *id)
 Generate key pair and save in KeyChain. More...
 
bool load (KeyChain &keyChain, const char *id, Region &region, EcPrivateKey &pvt, EcPublicKey &pub)
 Load key pair from KeyChain. More...
 
bool isCertificate (const Data &data)
 Determine if the Data packet is a certificate that contains an EC public key. More...
 

Function Documentation

◆ generate() [1/2]

bool ndnph::ec::generate ( Region region,
const Name name,
EcPrivateKey pvt,
EcPublicKey pub 
)
inline

Generate key pair.

Parameters
regionwhere to allocate key name.
namesubject name or key name; can be released afterwards.
[out]pvtthe private key.
[out]pubthe public key.
Returns
whether success.

◆ generate() [2/2]

bool ndnph::ec::generate ( Region region,
const Name name,
EcPrivateKey pvt,
EcPublicKey pub,
KeyChain keyChain,
const char *  id 
)
inline

Generate key pair and save in KeyChain.

Parameters
regionwhere to allocate key name.
namesubject name or key name; can be released afterwards.
[out]pvtthe private key.
[out]pubthe public key.
keyChainwhere to save the key pair.
idid within keyChain.
Returns
whether success.

◆ generateRaw()

bool ndnph::ec::generateRaw ( uint8_t  pvt[EcPrivateKey::KeyLen::value],
uint8_t  pub[EcPublicKey::KeyLen::value] 
)
inline

Generate key pair in raw format.

Returns
whether success.

◆ isCertificate()

bool ndnph::ec::isCertificate ( const Data data)
inline

Determine if the Data packet is a certificate that contains an EC public key.

It is unnecessary to call this function before EcPublicKey::import().

◆ load()

bool ndnph::ec::load ( KeyChain keyChain,
const char *  id,
Region region,
EcPrivateKey pvt,
EcPublicKey pub 
)
inline

Load key pair from KeyChain.

Returns
whether success.