41 const Buffer& encryptedKeyBag)
42 : m_certificate(certificate)
43 , m_encryptedKeyBag(encryptedKeyBag)
48 const uint8_t* encryptedKey,
49 size_t encryptedKeyLen)
50 : m_certificate(certificate)
51 , m_encryptedKeyBag(encryptedKey, encryptedKeyLen)
57 template<encoding::Tag TAG>
61 size_t totalLength = 0;
65 m_encryptedKeyBag.
get(),
66 m_encryptedKeyBag.size());
69 totalLength += this->m_certificate.
wireEncode(encoder);
71 totalLength += encoder.prependVarNumber(totalLength);
92 this->m_wire = buffer.block();
100 BOOST_THROW_EXCEPTION(
tlv::Error(
"Unexpected TLV type when decoding safebag"));
113 BOOST_THROW_EXCEPTION(
tlv::Error(
"Unexpected TLV structure when decoding certificate"));
117 this->m_encryptedKeyBag =
Buffer(it->value(), it->value_size());
121 BOOST_THROW_EXCEPTION(
tlv::Error(
"Unexpected TLV structure when decoding encryptedkeybag"));
125 BOOST_THROW_EXCEPTION(
tlv::Error(
"Unexpected TLV structure after decoding the block"));
element_const_iterator elements_begin() const
Copyright (c) 2011-2015 Regents of the University of California.
void wireDecode(const Block &wire)
Decode from the wire format.
EncodingImpl< EstimatorTag > EncodingEstimator
SafeBag()
Create a new empty SafeBag object.
element_const_iterator elements_end() const
void parse() const
Parse wire buffer into subblocks.
Class representing a wire element of NDN-TLV packet format.
void wireDecode(const Block &wire)
Decode the input from wire format.
EncodingImpl< EncoderTag > EncodingBuffer
element_container::const_iterator element_const_iterator
size_t wireEncode(EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
Fast encoding or block size estimation.
const Block & wireEncode() const
Encode to a wire format.
a concept check for TLV abstraction with .wireEncode method
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
Class representing a general-use automatically managed/resized buffer.
represents an error in TLV encoding or decoding