key-handle-osx.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #include "key-handle-osx.hpp"
23 #include "back-end-osx.hpp"
24 
25 namespace ndn {
26 namespace security {
27 namespace tpm {
28 
30  : m_impl(impl)
31  , m_key(key)
32 {
33  if (m_key.get() == 0)
34  BOOST_THROW_EXCEPTION(Error("key is not set"));
35 }
36 
38 KeyHandleOsx::doSign(DigestAlgorithm digestAlgorithm, const uint8_t* buf, size_t size) const
39 {
40  return m_impl.sign(m_key, digestAlgorithm, buf, size);
41 }
42 
44 KeyHandleOsx::doDecrypt(const uint8_t* cipherText, size_t cipherTextLen) const
45 {
46  return m_impl.decrypt(m_key, cipherText, cipherTextLen);
47 }
48 
50 KeyHandleOsx::doDerivePublicKey() const
51 {
52  return m_impl.derivePublicKey(m_key);
53 }
54 
55 } // namespace tpm
56 } // namespace security
57 } // namespace ndn
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.
ConstBufferPtr sign(const KeyRefOsx &key, DigestAlgorithm digestAlgorithm, const uint8_t *buf, size_t size) const
Sign buf with key using digestAlgorithm.
ConstBufferPtr derivePublicKey(const KeyRefOsx &key) const
ConstBufferPtr decrypt(const KeyRefOsx &key, const uint8_t *cipherText, size_t cipherSize) const
KeyHandleOsx(const BackEndOsx &impl, const KeyRefOsx &key)
shared_ptr< const Buffer > ConstBufferPtr
Definition: buffer.hpp:33