41 return doHasKey(keyName);
47 return doGetKeyHandle(keyName);
74 const_cast<KeyParams&
>(params).setKeyId(keyId);
82 return doCreateKey(identity, params);
97 return doExportKey(keyName, pw, pwLen);
106 doImportKey(keyName, pkcs8, pkcs8Len, pw, pwLen);
void setKeyName(const Name &keyName)
ConstBufferPtr derivePublicKey() const
uint64_t generateSecureWord64()
Generate a cryptographically secure random integer from the range [0, 2^64)
virtual void setTerminalMode(bool isTerminal) const
Set the terminal mode of the TPM.
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.
void deleteKey(const Name &keyName)
Delete the key with name keyName.
Abstraction of TPM key handle.
virtual bool isTpmLocked() const
Check if the TPM is locked.
std::string toUri() const
Get URI representation of the name.
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 isTerminalMode() const
Check if the TPM is in terminal mode.
bool hasKey(const Name &keyName) const
Check if the key with name keyName exists in the TPM.
Use the SHA256 hash of the public key as the key id.
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.
virtual bool unlockTpm(const char *pw, size_t pwLen) const
Unlock the TPM.
KeyIdType getKeyIdType() const
unique_ptr< KeyHandle > getKeyHandle(const Name &keyName) const
Get the handle of the key with name keyName.
Represents a name component.
shared_ptr< Buffer > buf()
Flush written data to the stream and return shared pointer to the underlying buffer.
Name constructKeyName(const Name &identity, const name::Component &keyId)
Construct key name based on the appropriate naming conventions.
static Component fromNumber(uint64_t number, uint32_t type=tlv::GenericNameComponent)
Create a component encoded as nonNegativeInteger.
Use a 64-bit random number as the key id.
Base class of key parameters.
implements an output stream that constructs ndn::Buffer
const name::Component & getKeyId() const
shared_ptr< const Buffer > ConstBufferPtr