|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
32 #include <boost/lexical_cast.hpp>
43 return doHasKey(keyName);
49 return doGetKeyHandle(keyName);
56 return doCreateKey(identity, params);
73 NDN_THROW(std::invalid_argument(
"Unsupported key id type " +
74 boost::lexical_cast<std::string>(params.
getKeyIdType())));
77 return doCreateKey(identity, params);
92 return doExportKey(keyName, pw, pwLen);
101 doImportKey(keyName, pkcs8, pkcs8Len, pw, pwLen);
110 doImportKey(keyName, key);
134 }
while (
hasKey(keyName));
static Component fromNumber(uint64_t number, uint32_t type=tlv::GenericNameComponent)
Create a component encoded as nonNegativeInteger.
Base class for key parameters.
@ RANDOM
Use a 64-bit random number as key id.
ConstBufferPtr derivePublicKey() const
ConstBufferPtr exportKey(const Name &keyName, const char *pw, size_t pwLen)
Get the private key with name keyName in encrypted PKCS #8 format.
Name constructHmacKeyName(const transform::PrivateKey &key, const Name &identity, const KeyParams ¶ms) const
Construct and return the name of a HMAC key, based on identity and params.
Name constructKeyName(const Name &identity, const name::Component &keyId)
Construct key name based on the appropriate naming conventions.
virtual void setTerminalMode(bool isTerminal) const
Set the terminal mode of the TPM.
const name::Component & getKeyId() const
unique_ptr< KeyHandle > createKey(const Name &identityName, const KeyParams ¶ms)
Create a key for identityName according to params.
Abstraction of TPM key handle.
KeyIdType getKeyIdType() const
Represents an absolute name.
unique_ptr< KeyHandle > getKeyHandle(const Name &keyName) const
Get the handle of the key with name keyName.
virtual bool isTpmLocked() const
Check if the TPM is locked.
@ SHA256
Use the SHA256 hash of the public key as key id.
virtual NDN_CXX_NODISCARD bool unlockTpm(const char *pw, size_t pwLen) const
Unlock the TPM.
KeyType getKeyType() const
@ HMAC
HMAC key, supports sign/verify operations.
Name constructAsymmetricKeyName(const KeyHandle &key, const Name &identity, const KeyParams ¶ms) const
Construct and return the name of a RSA or EC key, based on identity and params.
virtual bool isTerminalMode() const
Check if the TPM is in terminal mode.
void toUri(std::ostream &os, name::UriFormat format=name::UriFormat::DEFAULT) const
Write URI representation of the name to the output stream.
implements an output stream that constructs ndn::Buffer
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.
Represents a name component.
@ USER_SPECIFIED
User-specified key id.
bool hasKey(const Name &keyName) const
Check if the key with name keyName exists in the TPM.
void deleteKey(const Name &keyName)
Delete the key with name keyName.
shared_ptr< Buffer > buf()
Flush written data to the stream and return shared pointer to the underlying buffer.
shared_ptr< const Buffer > ConstBufferPtr
uint64_t generateSecureWord64()
Generate a cryptographically secure random integer from the range [0, 2^64)
Copyright (c) 2011-2015 Regents of the University of California.