20 #ifndef NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP 21 #define NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP 23 #include <ndn-cxx/security/key-chain.hpp> 47 virtual shared_ptr<PublicKey>
59 virtual shared_ptr<IdentityCertificate>
118 std::string m_tpmLocator;
126 DummyTpm(
const std::string& locator);
129 setTpmPassword(
const uint8_t* password,
size_t passwordLength);
135 setInTerminal(
bool inTerminal);
138 getInTerminal()
const;
144 unlockTpm(
const char* password,
size_t passwordLength,
bool usePassword);
147 generateKeyPairInTpm(
const Name& keyName,
const KeyParams& params);
150 deleteKeyPairInTpm(
const Name& keyName);
152 virtual shared_ptr<PublicKey>
153 getPublicKeyFromTpm(
const Name& keyName);
156 signInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
160 decryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
163 encryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
166 generateSymmetricKeyInTpm(
const Name& keyName,
const KeyParams& params);
169 doesKeyExistInTpm(
const Name& keyName,
KeyClass keyClass);
172 generateRandomBlock(uint8_t* res,
size_t size);
175 addAppToAcl(
const Name& keyName,
KeyClass keyClass,
const std::string& appPath,
AclType acl);
182 exportPrivateKeyPkcs8FromTpm(
const Name& keyName);
185 importPrivateKeyPkcs8IntoTpm(
const Name& keyName,
const uint8_t* buffer,
size_t bufferSize);
188 importPublicKeyPkcs1IntoTpm(
const Name& keyName,
const uint8_t* buffer,
size_t bufferSize);
197 #endif // NDNSIM_UTILS_DUMMY_KEYCHAIN_HPP virtual shared_ptr< PublicKey > getPublicKey(const Name &keyName)
Get shared pointer to PublicKey object from the identity storage.
virtual Name getDefaultCertificateNameForKey(const Name &keyName)
Get name of the default certificate name for the specified key.
Copyright (c) 2011-2015 Regents of the University of California.
virtual void deleteCertificateInfo(const Name &certificateName)
Delete a certificate.
static const std::string SCHEME
virtual void deleteIdentityInfo(const Name &identity)
Delete an identity and related public keys and certificates.
virtual KeyType getPublicKeyType(const Name &keyName)
Get the type of the queried public key.
virtual shared_ptr< IdentityCertificate > getCertificate(const Name &certificateName)
Get a shared pointer to identity certificate object from the identity storage.
virtual void getAllKeyNames(std::vector< Name > &nameList, bool isDefault)
Get all the key names from public info.
virtual void setTpmLocator(const std::string &tpmLocator)
Set the corresponding TPM information to tpmLocator.
Class representing a wire element of NDN-TLV packet format.
DummyPublicInfo(const std::string &locator)
virtual bool revokeIdentity()
Revoke the identity.
virtual void getAllKeyNamesOfIdentity(const Name &identity, std::vector< Name > &nameList, bool isDefault)
Get all the key names of a particular identity.
virtual std::string getScheme()
return the scheme of the PibLocator
virtual bool doesPublicKeyExist(const Name &keyName)
Check if the specified key already exists.
SecTpm is the base class of the TPM classes.
virtual void getAllIdentities(std::vector< Name > &nameList, bool isDefault)
Get all the identities from public info.
static const std::string SCHEME
virtual Name getDefaultIdentity()
Get name of the default identity.
Name abstraction to represent an absolute name.
virtual void setDefaultKeyNameForIdentityInternal(const Name &keyName)
Set the default key name for the corresponding identity.
virtual void addKey(const Name &keyName, const PublicKey &publicKey)
Add a public key to the identity storage.
virtual bool doesCertificateExist(const Name &certificateName)
Check if the specified certificate already exists.
virtual void getAllCertificateNamesOfKey(const Name &keyName, std::vector< Name > &nameList, bool isDefault)
Get all the certificate name of a particular key name.
virtual void deletePublicKeyInfo(const Name &keyName)
Delete a public key and related certificates.
virtual void addIdentity(const Name &identityName)
Add a new identity.
virtual void setDefaultCertificateNameForKeyInternal(const Name &certificateName)
Set the default certificate name for the corresponding key.
Base class of key parameters.
virtual bool doesIdentityExist(const Name &identityName)
Check if the specified identity already exists.
virtual void getAllCertificateNames(std::vector< Name > &nameList, bool isDefault)
Get all the certificate name in public info.
shared_ptr< const Buffer > ConstBufferPtr
virtual Name getDefaultKeyNameForIdentity(const Name &identityName)
Get name of the default key name for the specified identity.
virtual std::string getTpmLocator()
Get TPM Locator.
SecPublicInfo is a base class for the storage of public information.
virtual void addCertificate(const IdentityCertificate &certificate)
Add a certificate to the identity storage.
virtual void setDefaultIdentityInternal(const Name &identityName)
Set the default identity.