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 a TLV block. More... | |
SafeBag (const Data &certificate, span< const uint8_t > encryptedKey) | |
Create a new SafeBag 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 Block & | wireEncode () const |
Encode to wire format. More... | |
void | wireDecode (const Block &wire) |
Decode the input from wire format. More... | |
const Data & | getCertificate () const |
Get the certificate data packet from safe bag. More... | |
span< const uint8_t > | getEncryptedKey () const |
Get the private key in PKCS #8 format from safe bag. More... | |
A secured container for sensitive information (certificate, private key)
Definition at line 38 of file safe-bag.hpp.
|
default |
Create a new empty SafeBag object.
|
explicit |
Create a new SafeBag object from a TLV block.
Definition at line 37 of file safe-bag.cpp.
References wireDecode().
ndn::security::SafeBag::SafeBag | ( | const Data & | certificate, |
span< const uint8_t > | encryptedKey | ||
) |
Create a new SafeBag object with the given certificate and private key.
certificate | The certificate data packet |
encryptedKey | A buffer with the private key in PKCS #8 format |
Definition at line 42 of file safe-bag.cpp.
size_t ndn::security::SafeBag::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
Definition at line 50 of file safe-bag.cpp.
References ndn::tlv::security::EncryptedKey, ndn::security::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(), ndn::encoding::prependBinaryBlock(), ndn::tlv::security::SafeBag, and ndn::Data::wireEncode().
const Block & ndn::security::SafeBag::wireEncode | ( | ) | const |
Encode to wire format.
Definition at line 68 of file safe-bag.cpp.
References wireEncode().
Referenced by wireEncode().
void ndn::security::SafeBag::wireDecode | ( | const Block & | wire | ) |
Decode the input from wire format.
Definition at line 81 of file safe-bag.cpp.
References ndn::Block::elements_begin(), ndn::Block::elements_end(), ndn::tlv::security::EncryptedKey, NDN_THROW, ndn::Block::parse(), ndn::tlv::security::SafeBag, ndn::Block::type(), and ndn::Data::wireDecode().
Referenced by SafeBag().
|
inline |
Get the certificate data packet from safe bag.
Definition at line 84 of file safe-bag.hpp.
Referenced by ndn::security::v2::KeyChain::importSafeBag().
|
inline |
Get the private key in PKCS #8 format from safe bag.
Definition at line 93 of file safe-bag.hpp.
References ndn::security::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS().
Referenced by ndn::security::v2::KeyChain::importSafeBag().