|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
22 #ifndef NDN_SECURITY_TPM_TPM_HPP
23 #define NDN_SECURITY_TPM_TPM_HPP
29 #include <unordered_map>
30 #include <boost/logic/tribool.hpp>
65 class Tpm : noncopyable
68 class Error :
public std::runtime_error
71 using std::runtime_error::runtime_error;
112 boost::logic::tribool
122 decrypt(
const uint8_t*
buf,
size_t size,
const Name& keyName)
const;
152 unlockTpm(
const char* password,
size_t passwordLength)
const;
162 Tpm(
const std::string& scheme,
const std::string&
location, unique_ptr<BackEnd>
impl);
209 const char* pw,
size_t pwLen);
235 findKey(
const Name& keyName)
const;
238 std::string m_scheme;
239 std::string m_location;
241 mutable std::unordered_map<Name, unique_ptr<KeyHandle>> m_keys;
243 const unique_ptr<BackEnd> m_backEnd;
255 #endif // NDN_SECURITY_TPM_TPM_HPP
Base class for key parameters.
ConstBufferPtr exportPrivateKey(const Name &keyName, const char *pw, size_t pwLen) const
Export a private key.
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string unique_ptr< BackEnd > impl
ConstBufferPtr getPublicKey(const Name &keyName) const
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const std::string & location
void deleteKey(const Name &keyName)
Delete a key pair with name keyName.
Abstraction of TPM key handle.
Represents an absolute name.
#define NDN_CXX_NODISCARD
The interface of signing key management.
boost::logic::tribool verify(const uint8_t *buf, size_t bufLen, const uint8_t *sig, size_t sigLen, const Name &keyName, DigestAlgorithm digestAlgorithm) const
Verify blob using the key with name keyName and using the digest digestAlgorithm.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
std::string getTpmLocator() const
void importPrivateKey(const Name &keyName, const uint8_t *pkcs8, size_t pkcs8Len, const char *pw, size_t pwLen)
Import a private key.
NDN_CXX_NODISCARD bool unlockTpm(const char *password, size_t passwordLength) const
Unlock the TPM.
void setTerminalMode(bool isTerminal) const
Set the terminal mode of the TPM.
void clearKeyCache()
Clear the key cache.
bool isTerminalMode() const
Check if the TPM is in terminal mode.
ConstBufferPtr decrypt(const uint8_t *buf, size_t size, const Name &keyName) const
Decrypt blob using the key with name keyName.
bool hasKey(const Name &keyName) const
Check if a private key exists.
Name createKey(const Name &identityName, const KeyParams ¶ms)
Create key for identityName according to params.
shared_ptr< const Buffer > ConstBufferPtr
Copyright (c) 2011-2015 Regents of the University of California.
ConstBufferPtr sign(const uint8_t *buf, size_t size, const Name &keyName, DigestAlgorithm digestAlgorithm) const
Sign blob using the key with name keyName and using the digest digestAlgorithm.