All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
tpm-back-end-memory.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_TPM_BACK_END_MEMORY_HPP
24 #define NDN_TPM_BACK_END_MEMORY_HPP
25 
26 #include <map>
27 #include "tpm-back-end.hpp"
28 
29 namespace ndn {
30 
31 class TpmPrivateKey;
32 
37 class TpmBackEndMemory : public TpmBackEnd {
38 public:
40 
41  static std::string
42  getScheme() { return "tpm-memory"; }
43 
44 private:
50  virtual bool
51  doHasKey(const Name& keyName) const;
52 
58  virtual ptr_lib::shared_ptr<TpmKeyHandle>
59  doGetKeyHandle(const Name& keyName) const;
60 
70  virtual ptr_lib::shared_ptr<TpmKeyHandle>
71  doCreateKey(const Name& identityName, const KeyParams& params);
72 
78  virtual void
79  doDeleteKey(const Name& keyName);
80 
94  virtual Blob
95  doExportKey(const Name& keyName, const uint8_t* password, size_t passwordLength);
96 
112  virtual void
113  doImportKey
114  (const Name& keyName, const uint8_t* pkcs8, size_t pkcs8Length,
115  const uint8_t* password, size_t passwordLength);
116 
117  // Disable the copy constructor and assignment operator.
118  TpmBackEndMemory(const TpmBackEndMemory& other);
119  TpmBackEndMemory& operator=(const TpmBackEndMemory& other);
120 
121  std::map<Name, ptr_lib::shared_ptr<TpmPrivateKey>> keys_;
122 };
123 
124 }
125 
126 #endif
TpmBackEnd is an abstract base class for a TPM backend implementation which provides a TpmKeyHandle t...
Definition: tpm-back-end.hpp:39
TpmBackEndMemory extends TpmBackEnd to implement a TPM back-end using in-memory storage.
Definition: tpm-back-end-memory.hpp:37
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
KeyParams is a base class for key parameters.
Definition: key-params.hpp:36