NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::v1::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 keyDerBuf in DER buffer. 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 43 of file public-key.hpp.

Constructor & Destructor Documentation

◆ PublicKey() [1/2]

ndn::security::v1::PublicKey::PublicKey ( )

The default constructor.

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

◆ PublicKey() [2/2]

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

Create a new PublicKey from keyDerBuf in DER buffer.

Parameters
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 40 of file public-key.cpp.

References decode().

Member Function Documentation

◆ get()

◆ set()

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

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

◆ getKeyType()

◆ computeDigest()

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

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

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

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

◆ encode()

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

◆ decode()

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

◆ operator==()

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

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

◆ operator!=()

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

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

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


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