NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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"
26 #include "identity-certificate.hpp"
27 
28 namespace ndn {
29 
31 {
32 public:
33  class Error : public tlv::Error
34  {
35  public:
36  explicit
37  Error(const std::string& what)
38  : tlv::Error(what)
39  {
40  }
41  };
42 
43  SecuredBag();
44 
45  explicit
46  SecuredBag(const Block& wire);
47 
48  SecuredBag(const IdentityCertificate& cert,
49  ConstBufferPtr key);
50 
51  virtual
52  ~SecuredBag();
53 
54  void
55  wireDecode(const Block& wire);
56 
57  const Block&
58  wireEncode() const;
59 
60  const IdentityCertificate&
62  {
63  return m_cert;
64  }
65 
67  getKey() const
68  {
69  return m_key;
70  }
71 
72 private:
73  IdentityCertificate m_cert;
74  ConstBufferPtr m_key;
75 
76  mutable Block m_wire;
77 };
78 
79 } // namespace ndn
80 
81 #endif // NDN_SECURITY_SECURED_BAG_HPP
Copyright (c) 2011-2015 Regents of the University of California.
void wireDecode(const Block &wire)
Definition: secured-bag.cpp:60
ConstBufferPtr getKey() const
Definition: secured-bag.hpp:67
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
Error(const std::string &what)
Definition: secured-bag.hpp:37
const Block & wireEncode() const
Definition: secured-bag.cpp:73
const IdentityCertificate & getCertificate() const
Definition: secured-bag.hpp:61
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:33
represents an error in TLV encoding or decoding
Definition: tlv.hpp:50
virtual ~SecuredBag()
Definition: secured-bag.cpp:55