The back-end implementation of TPM based on macOS Keychain Services. More...
#include <back-end-osx.hpp>
Classes | |
class | Impl |
Public Member Functions | |
BackEndOsx (const std::string &location="") | |
Create TPM backed based on macOS Keychain Services. More... | |
~BackEndOsx () final | |
bool | isTerminalMode () const final |
Check if the TPM is in terminal mode. More... | |
void | setTerminalMode (bool isTerminal) const final |
Set the terminal mode of the TPM. More... | |
bool | isTpmLocked () const final |
Check if the TPM is locked. More... | |
bool | unlockTpm (const char *pw, size_t pwLen) const final |
Unlock the TPM. More... | |
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< KeyHandle > | getKeyHandle (const Name &keyName) const |
Get the handle of the key with name keyName . More... | |
unique_ptr< KeyHandle > | createKey (const Name &identityName, const KeyParams ¶ms) |
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, const uint8_t *pkcs8, size_t pkcs8Len, const char *pw, size_t pwLen) |
Import a private key in encrypted PKCS #8 format. More... | |
Static Public Member Functions | |
static const std::string & | getScheme () |
static ConstBufferPtr | sign (const KeyRefOsx &key, DigestAlgorithm digestAlgorithm, const uint8_t *buf, size_t size) |
Sign buf with key using digestAlgorithm . More... | |
static ConstBufferPtr | decrypt (const KeyRefOsx &key, const uint8_t *cipherText, size_t cipherSize) |
static ConstBufferPtr | derivePublicKey (const KeyRefOsx &key) |
Additional Inherited Members | |
Static Protected Member Functions inherited from ndn::security::tpm::BackEnd | |
static void | setKeyName (KeyHandle &keyHandle, const Name &identity, const KeyParams ¶ms) |
Set the key name in keyHandle according to identity and params . More... | |
The back-end implementation of TPM based on macOS Keychain Services.
Definition at line 40 of file back-end-osx.hpp.
|
explicit |
Create TPM backed based on macOS Keychain Services.
location | Not used (required by the TPM registration interface). |
Definition at line 184 of file back-end-osx.cpp.
|
finaldefault |
|
static |
Definition at line 198 of file back-end-osx.cpp.
|
finalvirtual |
Check if the TPM is in terminal mode.
The default implementation always returns true.
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 205 of file back-end-osx.cpp.
|
finalvirtual |
Set the terminal mode of the TPM.
In terminal mode, the TPM will not ask for a password from the GUI. The default implementation does nothing.
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 211 of file back-end-osx.cpp.
|
finalvirtual |
Check if the TPM is locked.
The default implementation always returns false.
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 218 of file back-end-osx.cpp.
Referenced by unlockTpm().
|
finalvirtual |
Unlock the TPM.
The default implementation does nothing and returns !isTpmLocked()
.
pw | The password to unlock the TPM. |
pwLen | The length of the password. |
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 229 of file back-end-osx.cpp.
References isTpmLocked().
|
static |
Sign buf
with key
using digestAlgorithm
.
Definition at line 248 of file back-end-osx.cpp.
References ndn::detail::CFReleaser< T >::get(), ndn::security::tpm::getDigestAlgorithm(), ndn::security::tpm::getDigestSize(), ndn::security::tpm::getFailureReason(), and ndn::security::tpm::makeCFDataNoCopy().
|
static |
Definition at line 298 of file back-end-osx.cpp.
References ndn::detail::CFReleaser< T >::get(), ndn::security::tpm::getFailureReason(), and ndn::security::tpm::makeCFDataNoCopy().
|
static |
Definition at line 329 of file back-end-osx.cpp.
References ndn::security::transform::PrivateKey::derivePublicKey(), and ndn::security::tpm::exportItem().