The back-end implementation of TPM based on macOS Keychain Services. More...
#include <back-end-osx.hpp>
Classes | |
class | Error |
class | Impl |
Public Member Functions | |
BackEndOsx (const std::string &location="") | |
Create TPM backed based on macOS KeyChain service. More... | |
~BackEndOsx () override | |
bool | isTerminalMode () const final |
Check if TPM is in terminal mode. More... | |
void | setTerminalMode (bool isTerminal) const final |
Set the terminal mode of TPM. More... | |
bool | isTpmLocked () const final |
bool | unlockTpm (const char *pw, size_t pwLen) const final |
Unlock TPM. More... | |
Public Member Functions inherited from ndn::security::tpm::BackEnd | |
virtual | ~BackEnd () |
bool | hasKey (const Name &keyName) const |
unique_ptr< KeyHandle > | getKeyHandle (const Name &keyName) const |
unique_ptr< KeyHandle > | createKey (const Name &identity, const KeyParams ¶ms) |
Create key for identity according to params . More... | |
void | deleteKey (const Name &keyName) |
Delete a key with name keyName . More... | |
ConstBufferPtr | exportKey (const Name &keyName, const char *pw, size_t pwLen) |
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 39 of file back-end-osx.hpp.
|
explicit |
Create TPM backed based on macOS KeyChain service.
location | Not used (required by the TPM-registration interface) |
Definition at line 131 of file back-end-osx.cpp.
References ~BackEndOsx().
Referenced by ndn::security::tpm::BackEndOsx::Error::Error().
|
overridedefault |
Referenced by BackEndOsx(), and ndn::security::tpm::BackEndOsx::Error::Error().
|
static |
Definition at line 146 of file back-end-osx.cpp.
Referenced by ndn::security::tpm::BackEndOsx::Error::Error().
|
finalvirtual |
Check if TPM is in terminal mode.
Default implementation always returns true.
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 153 of file back-end-osx.cpp.
Referenced by ndn::security::tpm::BackEndOsx::Error::Error().
|
finalvirtual |
Set the terminal mode of TPM.
In terminal mode, TPM will not ask user permission from GUI.
Default implementation does nothing.
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 159 of file back-end-osx.cpp.
Referenced by ndn::security::tpm::BackEndOsx::Error::Error().
|
finalvirtual |
Default implementation always returns false.
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 166 of file back-end-osx.cpp.
Referenced by ndn::security::tpm::BackEndOsx::Error::Error(), and unlockTpm().
|
finalvirtual |
Unlock TPM.
pw | The password to unlock TPM |
pwLen | The password size. |
Default implementation always returns !isTpmLocked()
Reimplemented from ndn::security::tpm::BackEnd.
Definition at line 178 of file back-end-osx.cpp.
References isTpmLocked().
Referenced by ndn::security::tpm::BackEndOsx::Error::Error().
|
static |
Sign buf
with key
using digestAlgorithm
.
Definition at line 197 of file back-end-osx.cpp.
References ndn::util::CFReleaser< T >::get(), ndn::security::tpm::getDigestAlgorithm(), and ndn::security::tpm::getDigestSize().
Referenced by ndn::security::tpm::BackEndOsx::Error::Error(), and ndn::security::tpm::KeyHandleOsx::KeyHandleOsx().
|
static |
Definition at line 248 of file back-end-osx.cpp.
References ndn::util::CFReleaser< T >::get().
Referenced by ndn::security::tpm::BackEndOsx::Error::Error(), and ndn::security::tpm::KeyHandleOsx::KeyHandleOsx().
|
static |
Definition at line 281 of file back-end-osx.cpp.
References ndn::security::transform::PrivateKey::derivePublicKey(), ndn::EC, ndn::util::CFReleaser< T >::get(), ndn::security::tpm::getAsymKeyType(), ndn::SimplePublicKeyParams< KeyParamsInfo >::getKeySize(), ndn::KeyParams::getKeyType(), ndn::security::transform::PrivateKey::loadPkcs1(), ndn::RSA, ndn::security::tpm::BackEnd::setKeyName(), and ndn::Name::toUri().
Referenced by ndn::security::tpm::BackEndOsx::Error::Error(), and ndn::security::tpm::KeyHandleOsx::KeyHandleOsx().