22 #ifndef NDN_SECURITY_TPM_BACK_END_HPP 23 #define NDN_SECURITY_TPM_BACK_END_HPP 43 class Error :
public std::runtime_error
46 using std::runtime_error::runtime_error;
105 exportKey(
const Name& keyName,
const char* pw,
size_t pwLen);
119 importKey(
const Name& keyName,
const uint8_t* pkcs8,
size_t pkcs8Len,
const char* pw,
size_t pwLen);
161 unlockTpm(
const char* pw,
size_t pwLen)
const;
172 doHasKey(
const Name& keyName)
const = 0;
174 virtual unique_ptr<KeyHandle>
175 doGetKeyHandle(
const Name& keyName)
const = 0;
177 virtual unique_ptr<KeyHandle>
178 doCreateKey(
const Name& identity,
const KeyParams& params) = 0;
181 doDeleteKey(
const Name& keyName) = 0;
184 doExportKey(
const Name& keyName,
const char* pw,
size_t pwLen) = 0;
187 doImportKey(
const Name& keyName,
const uint8_t* pkcs8,
size_t pkcs8Len,
const char* pw,
size_t pwLen) = 0;
194 #endif // NDN_SECURITY_TPM_BACK_END_HPP Copyright (c) 2011-2015 Regents of the University of California.
void importKey(const Name &keyName, const uint8_t *pkcs8, size_t pkcs8Len, const char *pw, size_t pwLen)
Import a private key in encrypted PKCS #8 format.
unique_ptr< KeyHandle > createKey(const Name &identityName, const KeyParams ¶ms)
Create a key for identityName according to params.
virtual void setTerminalMode(bool isTerminal) const
Set the terminal mode of the TPM.
void deleteKey(const Name &keyName)
Delete the key with name keyName.
Abstraction of TPM key handle.
Abstract interface for a TPM backend implementation.
ConstBufferPtr exportKey(const Name &keyName, const char *pw, size_t pwLen)
Get the private key with name keyName in encrypted PKCS #8 format.
virtual bool unlockTpm(const char *pw, size_t pwLen) const
Unlock the TPM.
virtual bool isTerminalMode() const
Check if the TPM is in terminal mode.
Represents an absolute name.
static void setKeyName(KeyHandle &keyHandle, const Name &identity, const KeyParams ¶ms)
Set the key name in keyHandle according to identity and params.
bool hasKey(const Name &keyName) const
Check if the key with name keyName exists in the TPM.
unique_ptr< KeyHandle > getKeyHandle(const Name &keyName) const
Get the handle of the key with name keyName.
Base class of key parameters.
virtual bool isTpmLocked() const
Check if the TPM is locked.
shared_ptr< const Buffer > ConstBufferPtr