NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::tpm::BackEndFile Class Referencefinal

The back-end implementation of a file-based TPM. More...

#include <back-end-file.hpp>

Inheritance diagram for ndn::security::tpm::BackEndFile:
Collaboration diagram for ndn::security::tpm::BackEndFile:

Classes

class  Impl
 

Public Member Functions

 BackEndFile (const std::string &location="")
 Create file-based TPM backend. More...
 
 ~BackEndFile () final
 
- Public Member Functions inherited from ndn::security::tpm::BackEnd
virtual ~BackEnd ()
 
bool hasKey (const Name &keyName) const
 Check if the key with name keyName exists in the TPM. More...
 
unique_ptr< KeyHandlegetKeyHandle (const Name &keyName) const
 Get the handle of the key with name keyName. More...
 
unique_ptr< KeyHandlecreateKey (const Name &identityName, const KeyParams &params)
 Create a key for identityName according to params. More...
 
void deleteKey (const Name &keyName)
 Delete the key with name keyName. More...
 
ConstBufferPtr exportKey (const Name &keyName, const char *pw, size_t pwLen)
 Get the private key with name keyName in encrypted PKCS #8 format. More...
 
void importKey (const Name &keyName, span< const uint8_t > pkcs8, const char *pw, size_t pwLen)
 Import a private key in encrypted PKCS #8 format. More...
 
void importKey (const Name &keyName, shared_ptr< transform::PrivateKey > key)
 Import a private key. More...
 
virtual bool isTerminalMode () const
 Check if the TPM is in terminal mode. More...
 
virtual void setTerminalMode (bool isTerminal) const
 Set the terminal mode of the TPM. More...
 
virtual bool isTpmLocked () const
 Check if the TPM is locked. More...
 
virtual NDN_CXX_NODISCARD bool unlockTpm (const char *pw, size_t pwLen) const
 Unlock the TPM. More...
 

Static Public Member Functions

static const std::string & getScheme ()
 

Additional Inherited Members

- Public Types inherited from ndn::security::tpm::BackEnd
using Error = Tpm::Error
 
- Protected Member Functions inherited from ndn::security::tpm::BackEnd
Name constructAsymmetricKeyName (const KeyHandle &key, const Name &identity, const KeyParams &params) const
 Construct and return the name of a RSA or EC key, based on identity and params. More...
 
Name constructHmacKeyName (const transform::PrivateKey &key, const Name &identity, const KeyParams &params) const
 Construct and return the name of a HMAC key, based on identity and params. More...
 

Detailed Description

The back-end implementation of a file-based TPM.

In this TPM, each private key is stored in a separate file with permission 0400, i.e., owner read-only. The key is stored in PKCS #1 format in base64 encoding.

Definition at line 42 of file back-end-file.hpp.

Constructor & Destructor Documentation

◆ BackEndFile()

ndn::security::tpm::BackEndFile::BackEndFile ( const std::string &  location = "")
explicit

Create file-based TPM backend.

Parameters
locationDirectory to store private keys.

Definition at line 89 of file back-end-file.cpp.

References ~BackEndFile().

◆ ~BackEndFile()

ndn::security::tpm::BackEndFile::~BackEndFile ( )
finaldefault

Referenced by BackEndFile().

Member Function Documentation

◆ getScheme()


The documentation for this class was generated from the following files: