32 BOOST_CONCEPT_ASSERT((WireEncodable<SafeBag>));
33 BOOST_CONCEPT_ASSERT((WireDecodable<SafeBag>));
43 : m_certificate(certificate)
44 , m_encryptedKey(encryptedKey.begin(), encryptedKey.end())
48 template<encoding::Tag TAG>
52 size_t totalLength = 0;
58 totalLength += m_certificate.
wireEncode(encoder);
60 totalLength += encoder.prependVarNumber(totalLength);
76 m_wire = buffer.block();
102 m_encryptedKey =
Buffer(it->value(), it->value_size());
Represents a TLV element of the NDN packet format.
element_const_iterator elements_begin() const noexcept
Equivalent to elements().begin().
element_const_iterator elements_end() const noexcept
Equivalent to elements().end().
uint32_t type() const noexcept
Return the TLV-TYPE of the Block.
void parse() const
Parse TLV-VALUE into sub-elements.
General-purpose automatically managed/resized buffer.
Represents a Data packet.
void wireDecode(const Block &wire)
Decode from wire.
size_t wireEncode(EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
Prepend wire encoding to encoder.
A secured container for sensitive information (certificate, private key)
void wireDecode(const Block &wire)
Decode the input from wire format.
SafeBag()
Create a new empty SafeBag object.
const Block & wireEncode() const
Encode to wire format.
Represents an error in TLV encoding or decoding.
#define NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
EncodingImpl< EstimatorTag > EncodingEstimator
size_t prependBinaryBlock(EncodingImpl< TAG > &encoder, uint32_t type, span< const uint8_t > value)
Prepend a TLV element containing a sequence of raw bytes.
EncodingImpl< EncoderTag > EncodingBuffer