All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
tpm-back-end-file.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_TPM_BACK_END_FILE_HPP
24 #define NDN_TPM_BACK_END_FILE_HPP
25 
26 #include "tpm-back-end.hpp"
27 
28 namespace ndn {
29 
30 class TpmPrivateKey;
31 
38 class TpmBackEndFile : public TpmBackEnd {
39 public:
44  class Error : public TpmBackEnd::Error
45  {
46  public:
47  Error(const std::string& what)
48  : TpmBackEnd::Error(what)
49  {
50  }
51  };
52 
59  TpmBackEndFile(const std::string& locationPath = "");
60 
61  static std::string
62  getScheme() { return "tpm-file"; }
63 
64 private:
70  virtual bool
71  doHasKey(const Name& keyName) const;
72 
78  virtual ptr_lib::shared_ptr<TpmKeyHandle>
79  doGetKeyHandle(const Name& keyName) const;
80 
90  virtual ptr_lib::shared_ptr<TpmKeyHandle>
91  doCreateKey(const Name& identityName, const KeyParams& params);
92 
98  virtual void
99  doDeleteKey(const Name& keyName);
100 
101  // TODO: doExportKey.
102  // TODO: doImportKey.
103 
109  ptr_lib::shared_ptr<TpmPrivateKey>
110  loadKey(const Name& keyName) const;
111 
117  void
118  saveKey(const Name& keyName, const ptr_lib::shared_ptr<TpmPrivateKey>& key);
119 
126  std::string
127  toFilePath(const Name& keyName) const;
128 
129  std::string keyStorePath_;
130 };
131 
132 }
133 
134 #endif
TpmBackEnd is an abstract base class for a TPM backend implementation which provides a TpmKeyHandle t...
Definition: tpm-back-end.hpp:39
TpmBackEndFile(const std::string &locationPath="")
Create a TpmBackEndFile to use the given path to store files.
Definition: tpm-back-end-file.cpp:37
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A TpmBackEndFile::Error extends TpmBackEnd::Error and represents a non-semantic error in backend TPM ...
Definition: tpm-back-end-file.hpp:44
KeyParams is a base class for key parameters.
Definition: key-params.hpp:36
TpmBackEndFile extends TpmBackEnd to implement a TPM back-end using on-disk file storage.
Definition: tpm-back-end-file.hpp:38
A TpmBackEnd::Error extends runtime_error and represents a non-semantic error in backend TPM processi...
Definition: tpm-back-end.hpp:45