20 #ifndef NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP 21 #define NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP 23 #include <ndn-cxx/security/key-chain.hpp> 24 #include <ndn-cxx/security/security-common.hpp> 25 #include <ndn-cxx/security/pib/pib-impl.hpp> 26 #include <ndn-cxx/security/tpm/back-end.hpp> 27 #include <ndn-cxx/security/transform/private-key.hpp> 39 class Error :
public PibImpl::Error
44 : PibImpl::
Error(what)
50 explicit DummyPib(
const std::string& locator);
86 addKey(
const Name& identity,
const Name& keyName,
const uint8_t* key,
87 size_t keyLen)
override;
132 std::string m_tpmLocator;
148 doSign(
DigestAlgorithm digestAlgorithm,
const uint8_t* buf,
size_t size)
const final;
151 doDecrypt(
const uint8_t* cipherText,
size_t cipherTextLen)
const final;
154 doDerivePublicKey()
const final;
170 : BackEnd::
Error(what)
176 explicit DummyTpm(
const std::string& locator);
179 isTerminalMode()
const override;
182 setTerminalMode(
bool isTerminal)
const override;
185 isTpmLocked()
const override;
188 sign(
const uint8_t* buf,
size_t size,
const Name& keyName,
DigestAlgorithm digestAlgorithm)
const;
195 doHasKey(
const Name& keyName)
const final;
197 unique_ptr<tpm::KeyHandle>
198 doGetKeyHandle(
const Name& keyName)
const final;
200 unique_ptr<tpm::KeyHandle>
201 doCreateKey(
const Name& identity,
const KeyParams& params)
final;
204 doDeleteKey(
const Name& keyName)
final;
207 doExportKey(
const Name& keyName,
const char* pw,
size_t pwLen)
final;
210 doImportKey(
const Name& keyName,
const uint8_t* pkcs8,
size_t pkcs8Len,
const char* pw,
size_t pwLen)
final;
219 #endif // NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP static const std::string SCHEME
bool hasKey(const Name &keyName) const override
Copyright (c) 2011-2015 Regents of the University of California.
The certificate following the certificate format naming convention.
void setTpmLocator(const std::string &tpmLocator) override
void removeKey(const Name &keyName) override
void addKey(const Name &identity, const Name &keyName, const uint8_t *key, size_t keyLen) override
std::set< Name > getIdentities() const override
Buffer getKeyBits(const Name &keyName) const override
Name getDefaultKeyOfIdentity(const Name &identity) const override
std::set< Name > getCertificatesOfKey(const Name &keyName) const override
Abstraction of TPM key handle.
void setDefaultKeyOfIdentity(const Name &identity, const Name &keyName) override
Error(const std::string &what)
DummyPib(const std::string &locator)
void clearIdentities() override
Catch-all error for security policy errors that don't fit in other categories.
static std::string getScheme()
void removeCertificate(const Name &certName) override
void addCertificate(const v2::Certificate &certificate) override
std::set< Name > getKeysOfIdentity(const Name &identity) const override
v2::Certificate getCertificate(const Name &certificateName) const override
static const std::string SCHEME
bool hasCertificate(const Name &certName) const override
bool hasIdentity(const Name &identityName) const override
void addIdentity(const Name &identityName) override
Represents an absolute name.
Name getDefaultIdentity() const override
void setDefaultCertificateOfKey(const Name &keyName, const Name &certName) override
Error(const std::string &what)
std::string getTpmLocator() const override
Base class of key parameters.
void setDefaultIdentity(const Name &identityName) override
General-purpose automatically managed/resized buffer.
void removeIdentity(const Name &identity) override
v2::Certificate getDefaultCertificateOfKey(const Name &keyName) const override
shared_ptr< const Buffer > ConstBufferPtr