NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
back-end-mem.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_TPM_BACK_END_MEM_HPP
23 #define NDN_SECURITY_TPM_BACK_END_MEM_HPP
24 
25 #include "back-end.hpp"
26 
27 namespace ndn {
28 namespace security {
29 namespace tpm {
30 
34 class BackEndMem : public BackEnd
35 {
36 public:
37  class Error : public BackEnd::Error
38  {
39  public:
40  explicit
41  Error(const std::string& what)
42  : BackEnd::Error(what)
43  {
44  }
45  };
46 
47 public:
52  explicit
53  BackEndMem(const std::string& location = "");
54 
55  ~BackEndMem() override;
56 
57  static const std::string&
58  getScheme();
59 
60 private: // inherited from tpm::BackEnd
61 
65  bool
66  doHasKey(const Name& keyName) const final;
67 
71  unique_ptr<KeyHandle>
72  doGetKeyHandle(const Name& keyName) const final;
73 
84  unique_ptr<KeyHandle>
85  doCreateKey(const Name& identityName, const KeyParams& params) final;
86 
92  void
93  doDeleteKey(const Name& keyName) final;
94 
100  doExportKey(const Name& keyName, const char* pw, size_t pwLen) final;
101 
112  void
113  doImportKey(const Name& keyName, const uint8_t* buf, size_t size, const char* pw, size_t pwLen) final;
114 
115 private:
116  class Impl;
117  const unique_ptr<Impl> m_impl;
118 };
119 
120 } // namespace tpm
121 } // namespace security
122 } // namespace ndn
123 
124 #endif // NDN_SECURITY_TPM_BACK_END_MEM_HPP
Copyright (c) 2011-2015 Regents of the University of California.
Error(const std::string &what)
BackEndMem(const std::string &location="")
Create memory-based TPM backend.
Abstraction of Tpm back-end.
Definition: back-end.hpp:41
Catch-all error for security policy errors that don&#39;t fit in other categories.
Definition: base.hpp:79
The back-end implementation of in-memory TPM.
Represents an absolute name.
Definition: name.hpp:42
static const std::string & getScheme()
Base class of key parameters.
Definition: key-params.hpp:35
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:89