NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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

ndn::PublicKey::PublicKey ( )

The default constructor.

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

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

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

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

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().

Referenced by ndn::security::Identity::getName().

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().

void ndn::PublicKey::decode ( CryptoPP::BufferedTransformation &  in)
bool ndn::PublicKey::operator== ( const PublicKey key) const
inline

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

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

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

References ns3::ndn::operator<<().


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