20 #ifndef NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP 21 #define NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP 50 explicit DummyPib(
const std::string& locator);
86 addKey(
const Name& identity,
const Name& keyName, span<const uint8_t> key)
override;
131 std::string m_tpmLocator;
150 doVerify(
DigestAlgorithm digestAlgorithm,
const InputBuffers& bufs, span<const uint8_t>
sig)
const final;
153 doDecrypt(span<const uint8_t> cipherText)
const final;
156 doDerivePublicKey()
const final;
178 explicit DummyTpm(
const std::string& locator);
181 isTerminalMode()
const override;
184 setTerminalMode(
bool isTerminal)
const override;
187 isTpmLocked()
const override;
197 doHasKey(
const Name& keyName)
const final;
199 unique_ptr<tpm::KeyHandle>
200 doGetKeyHandle(
const Name& keyName)
const final;
202 unique_ptr<tpm::KeyHandle>
203 doCreateKey(
const Name& identity,
const KeyParams& params)
final;
206 doDeleteKey(
const Name& keyName)
final;
209 doExportKey(
const Name& keyName,
const char* pw,
size_t pwLen)
final;
212 doImportKey(
const Name& keyName, span<const uint8_t> pkcs8,
const char* pw,
size_t pwLen)
final;
215 doImportKey(
const Name& keyName, shared_ptr<transform::PrivateKey> key)
final;
224 #endif // NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP represents a non-semantic error
static const std::string SCHEME
bool hasKey(const Name &keyName) const override
Check the existence of a key with keyName.
Certificate getDefaultCertificateOfKey(const Name &keyName) const override
Copyright (c) 2011-2015 Regents of the University of California.
void setTpmLocator(const std::string &tpmLocator) override
Set the corresponding TPM information to tpmLocator.
void removeKey(const Name &keyName) override
Remove a key with keyName and related certificates.
std::set< Name > getIdentities() const override
Get the name of all the identities.
Buffer getKeyBits(const Name &keyName) const override
Get the key bits of a key with name keyName.
Name getDefaultKeyOfIdentity(const Name &identity) const override
std::set< Name > getCertificatesOfKey(const Name &keyName) const override
Get a list of certificate names of a key with id keyName.
Abstraction of TPM key handle.
void setDefaultKeyOfIdentity(const Name &identity, const Name &keyName) override
Set an key with keyName as the default key of an identity with name identity.
Error(const std::string &what)
DummyPib(const std::string &locator)
void clearIdentities() override
Erasing all certificates, keys, and identities.
Abstract interface for a TPM backend implementation.
static std::string getScheme()
void removeCertificate(const Name &certName) override
Remove a certificate with name certName.
Certificate getCertificate(const Name &certificateName) const override
Get a certificate with name certName.
void addCertificate(const Certificate &certificate) override
Add a certificate.
std::set< Name > getKeysOfIdentity(const Name &identity) const override
Get all the key names of an identity with name identity.
static const std::string SCHEME
bool hasCertificate(const Name &certName) const override
Check the existence of a certificate with name certName.
bool hasIdentity(const Name &identityName) const override
Check the existence of an identity.
void addIdentity(const Name &identityName) override
Add an identity.
Represents an absolute name.
void addKey(const Name &identity, const Name &keyName, span< const uint8_t > key) override
Add a key.
Name getDefaultIdentity() const override
Get the default identity.
void setDefaultCertificateOfKey(const Name &keyName, const Name &certName) override
Set a cert with name certName as the default of a key with keyName.
Error(const std::string &what)
std::string getTpmLocator() const override
Get TPM Locator.
Base class for key parameters.
void setDefaultIdentity(const Name &identityName) override
Set an identity with name identityName as the default identity.
span_constexpr std::size_t size(span< T, Extent > const &spn)
General-purpose automatically managed/resized buffer.
void removeIdentity(const Name &identity) override
Remove an identity and related keys and certificates.
Abstract class of PIB implementation.
span< const uint8_t > sig
shared_ptr< const Buffer > ConstBufferPtr