NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::PublicKey Class Reference

#include <public-key.hpp>

Classes

class  Error
 

Public Member Functions

 PublicKey ()
 The default constructor. More...
 
 PublicKey (const uint8_t *keyDerBuf, size_t keyDerSize)
 Create a new PublicKey from. More...
 
const Bufferget () const
 
void set (const uint8_t *keyDerBuf, size_t keyDerSize)
 
KeyType getKeyType () const
 
const BlockcomputeDigest () const
 
void encode (CryptoPP::BufferedTransformation &out) const
 
void decode (CryptoPP::BufferedTransformation &in)
 
bool operator== (const PublicKey &key) const
 
bool operator!= (const PublicKey &key) const
 

Detailed Description

Definition at line 41 of file public-key.hpp.

Constructor & Destructor Documentation

◆ PublicKey() [1/2]

ndn::PublicKey::PublicKey ( )

The default constructor.

Definition at line 33 of file public-key.cpp.

◆ PublicKey() [2/2]

ndn::PublicKey::PublicKey ( const uint8_t *  keyDerBuf,
size_t  keyDerSize 
)

Create a new PublicKey from.

Parameters
keyDerBufin DER buffer
keyDerBufThe pointer to the first byte of buffer containing DER of public key
keyDerSizeSize of the buffer
Exceptions
PublicKey::ErrorIf DER in buffer cannot be decoded

Definition at line 38 of file public-key.cpp.

References decode().

Member Function Documentation

◆ get()

const Buffer& ndn::PublicKey::get ( ) const
inline

◆ set()

void ndn::PublicKey::set ( const uint8_t *  keyDerBuf,
size_t  keyDerSize 
)
inline

Definition at line 76 of file public-key.hpp.

◆ getKeyType()

◆ computeDigest()

const Block & ndn::PublicKey::computeDigest ( ) const
Returns
a KeyDigest block that matches this public key

Definition at line 46 of file public-key.cpp.

References ndn::Buffer::buf(), ndn::Block::encode(), ndn::Block::hasWire(), ndn::tlv::KeyDigest, and ndn::crypto::sha256().

◆ encode()

void ndn::PublicKey::encode ( CryptoPP::BufferedTransformation &  out) const

Definition at line 62 of file public-key.cpp.

References ndn::Buffer::buf().

Referenced by ndn::Certificate::encode(), and ndn::Certificate::printCertificate().

◆ decode()

void ndn::PublicKey::decode ( CryptoPP::BufferedTransformation &  in)

◆ operator==()

bool ndn::PublicKey::operator== ( const PublicKey key) const
inline

Definition at line 101 of file public-key.hpp.

◆ operator!=()

bool ndn::PublicKey::operator!= ( const PublicKey key) const
inline

Definition at line 107 of file public-key.hpp.


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