NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
secured-bag.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_SECURED_BAG_HPP
23 #define NDN_SECURITY_SECURED_BAG_HPP
24 
25 #include "../common.hpp"
27 
28 namespace ndn {
29 namespace security {
30 
32 {
33 public:
34  class Error : public tlv::Error
35  {
36  public:
37  explicit
38  Error(const std::string& what)
39  : tlv::Error(what)
40  {
41  }
42  };
43 
44  SecuredBag();
45 
46  explicit
47  SecuredBag(const Block& wire);
48 
50  ConstBufferPtr key);
51 
52  virtual
53  ~SecuredBag();
54 
55  void
56  wireDecode(const Block& wire);
57 
58  const Block&
59  wireEncode() const;
60 
63  {
64  return m_cert;
65  }
66 
68  getKey() const
69  {
70  return m_key;
71  }
72 
73 private:
75  ConstBufferPtr m_key;
76 
77  mutable Block m_wire;
78 };
79 
80 } // namespace security
81 
83 
84 } // namespace ndn
85 
86 #endif // NDN_SECURITY_SECURED_BAG_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
const Block & wireEncode() const
Definition: secured-bag.cpp:73
Error(const std::string &what)
Definition: secured-bag.hpp:38
void wireDecode(const Block &wire)
Definition: secured-bag.cpp:60
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:33
ConstBufferPtr getKey() const
Definition: secured-bag.hpp:68
const v1::IdentityCertificate & getCertificate() const
Definition: secured-bag.hpp:62
represents an error in TLV encoding or decoding
Definition: tlv.hpp:50