22 #ifndef NDN_SECURITY_TPM_TPM_HPP 23 #define NDN_SECURITY_TPM_TPM_HPP 25 #include "../security-common.hpp" 26 #include "../../name.hpp" 27 #include "../key-params.hpp" 30 #include <unordered_map> 64 class Tpm : noncopyable
67 class Error :
public std::runtime_error
72 :
std::runtime_error(what)
81 getTpmLocator()
const;
90 hasKey(
const Name& keyName)
const;
99 getPublicKey(
const Name& keyName)
const;
107 sign(
const uint8_t* buf,
size_t size,
const Name& keyName,
DigestAlgorithm digestAlgorithm)
const;
115 decrypt(
const uint8_t* buf,
size_t size,
const Name& keyName)
const;
122 isTerminalMode()
const;
130 setTerminalMode(
bool isTerminal)
const;
145 unlockTpm(
const char* password,
size_t passwordLength)
const;
155 Tpm(
const std::string& scheme,
const std::string& location, unique_ptr<BackEnd> impl);
166 createKey(
const Name& identityName,
const KeyParams& params);
172 deleteKey(
const Name& keyName);
186 exportPrivateKey(
const Name& keyName,
const char* pw,
size_t pwLen)
const;
199 importPrivateKey(
const Name& keyName,
const uint8_t* pkcs8,
size_t pkcs8Len,
200 const char* pw,
size_t pwLen);
220 findKey(
const Name& keyName)
const;
223 std::string m_scheme;
224 std::string m_location;
226 mutable std::unordered_map<Name, unique_ptr<KeyHandle>> m_keys;
228 const unique_ptr<BackEnd> m_backEnd;
240 #endif // NDN_SECURITY_TPM_TPM_HPP
Copyright (c) 2013-2017 Regents of the University of California.
The interface of signing key management.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Abstraction of TPM key handle.
represents the front-end of TPM
Represents an absolute name.
Base class of key parameters.
Error(const std::string &what)
shared_ptr< const Buffer > ConstBufferPtr