key-handle-osx.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
23 #define NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
24 
25 #include "key-handle.hpp"
26 #include "helper-osx.hpp"
27 
28 #ifndef NDN_CXX_HAVE_OSX_SECURITY
29 #error "This file should not be compiled ..."
30 #endif
31 
32 namespace ndn {
33 namespace security {
34 namespace tpm {
35 
36 class BackEndOsx;
37 
41 class KeyHandleOsx : public KeyHandle
42 {
43 public:
44  class Error : public KeyHandle::Error
45  {
46  public:
47  explicit
48  Error(const std::string& what)
49  : KeyHandle::Error(what)
50  {
51  }
52  };
53 
54 public:
55  KeyHandleOsx(const BackEndOsx& impl, const KeyRefOsx& key);
56 
57 private:
59  doSign(DigestAlgorithm digestAlgorithm, const uint8_t* buf, size_t size) const final;
60 
62  doDecrypt(const uint8_t* cipherText, size_t cipherTextLen) const final;
63 
65  doDerivePublicKey() const final;
66 
67 private:
68  const BackEndOsx& m_impl;
69  KeyRefOsx m_key;
70 };
71 
72 } // namespace tpm
73 } // namespace security
74 } // namespace ndn
75 
76 #endif // NDN_SECURITY_TPM_KEY_HANDLE_OSX_HPP
Copyright (c) 2013-2016 Regents of the University of California.
Definition: common.hpp:74
The back-end implementation of TPM based on macOS Keychain Services.
Abstraction of TPM key handle.
Definition: key-handle.hpp:38
Abstraction of TPM key handle used by the TPM based on OS X Keychain Service.
KeyHandleOsx(const BackEndOsx &impl, const KeyRefOsx &key)
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:33