22 #ifndef NDN_SECURITY_TPM_TPM_HPP 23 #define NDN_SECURITY_TPM_TPM_HPP 29 #include <unordered_map> 63 class Tpm : noncopyable
66 class Error :
public std::runtime_error
69 using std::runtime_error::runtime_error;
76 getTpmLocator()
const;
85 hasKey(
const Name& keyName)
const;
94 getPublicKey(
const Name& keyName)
const;
102 sign(
const uint8_t* buf,
size_t size,
const Name& keyName,
DigestAlgorithm digestAlgorithm)
const;
110 decrypt(
const uint8_t* buf,
size_t size,
const Name& keyName)
const;
117 isTerminalMode()
const;
125 setTerminalMode(
bool isTerminal)
const;
140 unlockTpm(
const char* password,
size_t passwordLength)
const;
150 Tpm(
const std::string& scheme,
const std::string& location, unique_ptr<BackEnd> impl);
161 createKey(
const Name& identityName,
const KeyParams& params);
167 deleteKey(
const Name& keyName);
181 exportPrivateKey(
const Name& keyName,
const char* pw,
size_t pwLen)
const;
194 importPrivateKey(
const Name& keyName,
const uint8_t* pkcs8,
size_t pkcs8Len,
195 const char* pw,
size_t pwLen);
215 findKey(
const Name& keyName)
const;
218 std::string m_scheme;
219 std::string m_location;
221 mutable std::unordered_map<Name, unique_ptr<KeyHandle>> m_keys;
223 const unique_ptr<BackEnd> m_backEnd;
235 #endif // NDN_SECURITY_TPM_TPM_HPP
The interface of signing key management.
Abstraction of TPM key handle.
represents the front-end of TPM
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Represents an absolute name.
Base class of key parameters.
shared_ptr< const Buffer > ConstBufferPtr