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> 48 virtual shared_ptr<PublicKey>
60 virtual shared_ptr<IdentityCertificate>
119 std::string m_tpmLocator;
127 DummyTpm(
const std::string& locator);
130 setTpmPassword(
const uint8_t* password,
size_t passwordLength);
136 setInTerminal(
bool inTerminal);
139 getInTerminal()
const;
145 unlockTpm(
const char* password,
size_t passwordLength,
bool usePassword);
148 generateKeyPairInTpm(
const Name& keyName,
const KeyParams& params);
151 deleteKeyPairInTpm(
const Name& keyName);
153 virtual shared_ptr<PublicKey>
154 getPublicKeyFromTpm(
const Name& keyName);
157 signInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
161 decryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
164 encryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
167 generateSymmetricKeyInTpm(
const Name& keyName,
const KeyParams& params);
170 doesKeyExistInTpm(
const Name& keyName,
KeyClass keyClass);
173 generateRandomBlock(uint8_t* res,
size_t size);
176 addAppToAcl(
const Name& keyName,
KeyClass keyClass,
const std::string& appPath,
AclType acl);
183 exportPrivateKeyPkcs8FromTpm(
const Name& keyName);
186 importPrivateKeyPkcs8IntoTpm(
const Name& keyName,
const uint8_t* buffer,
size_t bufferSize);
189 importPublicKeyPkcs1IntoTpm(
const Name& keyName,
const uint8_t* buffer,
size_t bufferSize);
198 #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.
SecTpm is the base class of the TPM classes.
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.
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.
SecPublicInfo is a base class for the storage of public information.
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.
virtual void addCertificate(const IdentityCertificate &certificate)
Add a certificate to the identity storage.
virtual void setDefaultIdentityInternal(const Name &identityName)
Set the default identity.