8 #ifndef NDN_SECURITY_SEC_TPM_OSX_HPP
9 #define NDN_SECURITY_SEC_TPM_OSX_HPP
11 #include "../common.hpp"
55 unlockTpm(
const char* password,
size_t passwordLength,
bool usePassword);
69 virtual shared_ptr<PublicKey>
80 decryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
83 encryptInTpm(
const uint8_t* data,
size_t dataLength,
const Name& keyName,
bool isSymmetric);
130 const uint8_t* buf,
size_t size,
140 shared_ptr<Impl> m_impl;
145 #endif // NDN_SECURITY_SEC_TPM_OSX_HPP
void deleteKeyPairInTpmInternal(const Name &keyName, bool needRetry)
virtual bool getInTerminal()
get inTerminal flag
virtual Block signInTpm(const uint8_t *data, size_t dataLength, const Name &keyName, DigestAlgorithm digestAlgorithm)
Sign data.
virtual ConstBufferPtr encryptInTpm(const uint8_t *data, size_t dataLength, const Name &keyName, bool isSymmetric)
Encrypt data.
virtual bool importPublicKeyPkcs1IntoTpm(const Name &keyName, const uint8_t *buf, size_t size)
Import a public key in PKCS#1 format.
Class representing wire element of the NDN packet.
ConstBufferPtr exportPrivateKeyPkcs8FromTpmInternal(const Name &keyName, bool needRetry)
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, KeyType keyType, int keySize, bool needRetry)
virtual void setTpmPassword(const uint8_t *password, size_t passwordLength)
set password of TPM
virtual void deleteKeyPairInTpm(const Name &keyName)
Delete a key pair of asymmetric keys.
virtual ConstBufferPtr exportPrivateKeyPkcs8FromTpm(const Name &keyName)
Export a private key in PKCS#8 format.
virtual void resetTpmPassword()
reset password of TPM
virtual bool importPrivateKeyPkcs8IntoTpm(const Name &keyName, const uint8_t *buf, size_t size)
Import a private key in PKCS#8 format.
ptr_lib::shared_ptr< const Buffer > ConstBufferPtr
virtual bool locked()
check if TPM is locked.
virtual void generateSymmetricKeyInTpm(const Name &keyName, KeyType keyType, int keySize)
Generate a symmetric key.
virtual shared_ptr< PublicKey > getPublicKeyFromTpm(const Name &keyName)
Get a public key.
SecTpm is the base class of the TPM classes.
Error(const std::string &what)
bool importPrivateKeyPkcs8IntoTpmInternal(const Name &keyName, const uint8_t *buf, size_t size, bool needRetry)
A Name holds an array of Name::Component and represents an NDN name.
virtual ConstBufferPtr decryptInTpm(const uint8_t *data, size_t dataLength, const Name &keyName, bool isSymmetric)
Decrypt data.
virtual void generateKeyPairInTpm(const Name &keyName, KeyType keyType, int keySize)
Generate a pair of asymmetric keys.
virtual bool doesKeyExistInTpm(const Name &keyName, KeyClass keyClass)
Check if a particular key exists.
virtual void setInTerminal(bool inTerminal)
set inTerminal flag
Block signInTpmInternal(const uint8_t *data, size_t dataLength, const Name &keyName, DigestAlgorithm digestAlgorithm, bool needRetry)
virtual bool generateRandomBlock(uint8_t *res, size_t size)
Generate a random block.
virtual bool unlockTpm(const char *password, size_t passwordLength, bool usePassword)
Unlock the TPM.