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

a secured container for sensitive information(certificate, private key) More...

#include <safe-bag.hpp>

Public Member Functions

 SafeBag ()
 Create a new empty SafeBag object. More...
 
 SafeBag (const Block &wire)
 Create a new SafeBag object from the block. More...
 
 SafeBag (const Data &certificate, const Buffer &encryptedKeyBag)
 Create a new Safe object with the given certificate and private key. More...
 
 SafeBag (const Data &certificate, const uint8_t *encryptedKey, size_t encryptedKeyLen)
 Create a new Safe object with the given certificate and private key. More...
 
template<encoding::Tag TAG>
size_t wireEncode (EncodingImpl< TAG > &encoder) const
 Fast encoding or block size estimation. More...
 
const BlockwireEncode () const
 Encode to a wire format. More...
 
void wireDecode (const Block &wire)
 Decode the input from wire format. More...
 
const DatagetCertificate () const
 Get the certificate data packet from safe bag. More...
 
const BuffergetEncryptedKeyBag () const
 Get the private key in PKCS#8 from safe bag. More...
 

Detailed Description

a secured container for sensitive information(certificate, private key)

Definition at line 38 of file safe-bag.hpp.

Constructor & Destructor Documentation

◆ SafeBag() [1/4]

ndn::security::SafeBag::SafeBag ( )
default

Create a new empty SafeBag object.

◆ SafeBag() [2/4]

ndn::security::SafeBag::SafeBag ( const Block wire)
explicit

Create a new SafeBag object from the block.

Definition at line 35 of file safe-bag.cpp.

References wireDecode().

◆ SafeBag() [3/4]

ndn::security::SafeBag::SafeBag ( const Data certificate,
const Buffer encryptedKeyBag 
)

Create a new Safe object with the given certificate and private key.

Parameters
certificateA reference to the certificate data packet
encryptedKeyBagA reference to the Buffer of private key in PKCS#8

Definition at line 40 of file safe-bag.cpp.

◆ SafeBag() [4/4]

ndn::security::SafeBag::SafeBag ( const Data certificate,
const uint8_t *  encryptedKey,
size_t  encryptedKeyLen 
)

Create a new Safe object with the given certificate and private key.

Parameters
certificateA reference to the certificate data packet
encryptedKeyA reference to the uint8_t* of private key in PKCS#8
encryptedKeyLenThe length of the encryptedKey

Definition at line 47 of file safe-bag.cpp.

Member Function Documentation

◆ wireEncode() [1/2]

template<encoding::Tag TAG>
size_t ndn::security::SafeBag::wireEncode ( EncodingImpl< TAG > &  encoder) const

Fast encoding or block size estimation.

Definition at line 59 of file safe-bag.cpp.

References ndn::tlv::security::EncryptedKeyBag, ndn::Buffer::get(), ndn::tlv::security::SafeBag, and ndn::Data::wireEncode().

◆ wireEncode() [2/2]

const Block & ndn::security::SafeBag::wireEncode ( ) const

Encode to a wire format.

Definition at line 84 of file safe-bag.cpp.

◆ wireDecode()

void ndn::security::SafeBag::wireDecode ( const Block wire)

◆ getCertificate()

const Data& ndn::security::SafeBag::getCertificate ( ) const
inline

Get the certificate data packet from safe bag.

Definition at line 97 of file safe-bag.hpp.

◆ getEncryptedKeyBag()

const Buffer& ndn::security::SafeBag::getEncryptedKeyBag ( ) const
inline

Get the private key in PKCS#8 from safe bag.

Definition at line 106 of file safe-bag.hpp.


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