24 #ifndef NDN_SECURITY_SEC_TPM_OSX_HPP 25 #define NDN_SECURITY_SEC_TPM_OSX_HPP 27 #include "../common.hpp" 29 #ifndef NDN_CXX_HAVE_OSX_SECURITY 30 #error "This files should not be compiled ..." 52 SecTpmOsx(
const std::string& location =
"");
74 unlockTpm(
const char* password,
size_t passwordLength,
bool usePassword);
88 virtual shared_ptr<v1::PublicKey>
99 decryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
102 encryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
148 const uint8_t* buf,
size_t size,
161 shared_ptr<Impl> m_impl;
170 #endif // NDN_SECURITY_SEC_TPM_OSX_HPP virtual ConstBufferPtr exportPrivateKeyPkcs8FromTpm(const Name &keyName)
Export a private key in PKCS#8 format.
Copyright (c) 2011-2015 Regents of the University of California.
virtual bool importPublicKeyPkcs1IntoTpm(const Name &keyName, const uint8_t *buf, size_t size)
Import a public key in PKCS#1 formatted buffer of size bufferSize.
virtual void setTpmPassword(const uint8_t *password, size_t passwordLength)
set password of TPM
virtual Block signInTpm(const uint8_t *data, size_t dataLength, const Name &keyName, DigestAlgorithm digestAlgorithm)
Sign data.
virtual shared_ptr< v1::PublicKey > getPublicKeyFromTpm(const Name &keyName)
Get a public key.
SecTpm is the base class of the TPM classes.
ConstBufferPtr exportPrivateKeyPkcs8FromTpmInternal(const Name &keyName, bool needRetry)
virtual ConstBufferPtr decryptInTpm(const uint8_t *data, size_t dataLength, const Name &keyName, bool isSymmetric)
Decrypt data.
Class representing a wire element of NDN-TLV packet format.
virtual bool getInTerminal() const
Get value of inTerminal flag.
SecTpmOsx(const std::string &location="")
virtual bool unlockTpm(const char *password, size_t passwordLength, bool usePassword)
Unlock the TPM.
virtual void deleteKeyPairInTpm(const Name &keyName)
Delete a key pair of asymmetric keys.
virtual std::string getScheme()
Name abstraction to represent an absolute name.
virtual void generateKeyPairInTpm(const Name &keyName, const KeyParams ¶ms)
Generate a pair of asymmetric keys.
virtual bool generateRandomBlock(uint8_t *res, size_t size)
Generate a random block.
virtual bool doesKeyExistInTpm(const Name &keyName, KeyClass keyClass)
Check if a particular key exists.
Error(const std::string &what)
virtual void generateSymmetricKeyInTpm(const Name &keyName, const KeyParams ¶ms)
Generate a symmetric key.
virtual ConstBufferPtr encryptInTpm(const uint8_t *data, size_t dataLength, const Name &keyName, bool isSymmetric)
Encrypt data.
Base class of key parameters.
virtual void addAppToAcl(const Name &keyName, KeyClass keyClass, const std::string &appPath, AclType acl)
Add the application into the ACL of a particular key.
void generateKeyPairInTpmInternal(const Name &keyName, const KeyParams ¶ms, bool needRetry)
void deleteKeyPairInTpmInternal(const Name &keyName, bool needRetry)
virtual bool isLocked()
Check if TPM is locked.
bool importPrivateKeyPkcs8IntoTpmInternal(const Name &keyName, const uint8_t *buf, size_t size, bool needRetry)
shared_ptr< const Buffer > ConstBufferPtr
static const std::string SCHEME
virtual bool importPrivateKeyPkcs8IntoTpm(const Name &keyName, const uint8_t *buf, size_t size)
Import a private key from PKCS#8 formatted buffer of size bufferSize.
Block signInTpmInternal(const uint8_t *data, size_t dataLength, const Name &keyName, DigestAlgorithm digestAlgorithm, bool needRetry)
virtual void setInTerminal(bool inTerminal)
Set inTerminal flag to inTerminal.
virtual void resetTpmPassword()
reset password of TPM