23 #ifndef NDN_TPM_BACK_END_OSX_HPP
24 #define NDN_TPM_BACK_END_OSX_HPP
27 #include "../../ndn-cpp-config.h"
28 #if NDN_CPP_HAVE_OSX_SECURITY
30 #include "helper-osx.hpp"
31 #include "tpm-back-end.hpp"
39 class TpmBackEndOsx :
public TpmBackEnd {
45 class Error :
public TpmBackEnd::Error
48 Error(
const std::string& what)
49 : TpmBackEnd::Error(what)
59 TpmBackEndOsx(
const std::string& location =
"");
62 getScheme() {
return "tpm-osxkeychain"; }
71 isTerminalMode()
const;
79 setTerminalMode(
bool isTerminal)
const;
95 unlockTpm(
const uint8_t* password,
size_t passwordLength)
const;
104 (
const KeyRefOsx& key, DigestAlgorithm digestAlgorithm,
105 const uint8_t* data,
size_t dataLength);
109 (
const KeyRefOsx& key,
const uint8_t* cipherText,
size_t cipherTextLength);
112 derivePublicKey(
const KeyRefOsx& key);
121 doHasKey(
const Name& keyName)
const;
128 virtual ptr_lib::shared_ptr<TpmKeyHandle>
129 doGetKeyHandle(
const Name& keyName)
const;
140 virtual ptr_lib::shared_ptr<TpmKeyHandle>
141 doCreateKey(
const Name& identityName,
const KeyParams& params);
149 doDeleteKey(
const Name& keyName);
159 static CFReleaser<SecKeychainItemRef>
160 getKey(
const Name& keyName);
162 SecKeychainRef keyChainRef_;
163 bool isTerminalMode_;
168 #endif // NDN_CPP_HAVE_OSX_SECURITY