EC public key.
More...
#include <ec.hpp>
Inherits ndnph::detail::NamedPublicKey< SigType::Sha256WithEcdsa >.
◆ KeyLen
◆ buildCertificate()
template<typename Signer >
Generate certificate of this public key.
- Parameters
-
name | key name or certificate name. |
validity | certificate validity period. |
signer | certificate issuer. |
- Returns
- result object supporting explicit conversion to bool and equipped with a `void encodeTo(Encoder&) const` method. `!result` indicates the operation has failed. Encodable object is valid only if arguments to this function are kept alive.
◆ import() [1/2]
bool ndnph::ec::EcPublicKey::import |
( |
const Name & |
name, |
|
|
const uint8_t |
raw[KeyLen::value] |
|
) |
| |
|
inline |
Import from raw key bits.
- Parameters
-
name | key name; will be referenced. |
raw | raw key bits; will be copied. |
- Returns
- whether success.
◆ import() [2/2]
bool ndnph::ec::EcPublicKey::import |
( |
Region & |
region, |
|
|
const Data & |
data |
|
) |
| |
|
inline |
Import a public key from certificate.
- Parameters
-
region | where to copy key name. |
data | certificate; it can be freed after this operation. |
- Returns
- whether success.
◆ operator bool()
ndnph::ec::EcPublicKey::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Determine if this key is non-empty.
◆ selfSign()
template<typename Signer >
Generate self-signed certificate of this public key.
- Parameters
-
validity | certificate validity period. |
signer | corresponding private key. |
- Returns
- result object supporting explicit conversion to bool and equipped with a `void encodeTo(Encoder&) const` method. `!result` indicates the operation has failed. Encodable object is valid only if arguments to this function are kept alive.
◆ verify()
bool ndnph::ec::EcPublicKey::verify |
( |
std::initializer_list< tlv::Value > |
chunks, |
|
|
const uint8_t * |
sig, |
|
|
size_t |
sigLen |
|
) |
| const |
|
inlinefinalvirtual |
Perform verification.
- Return values
-
true | signature is correct. |
false | error or signature is incorrect. |
Implements ndnph::PublicKey.
The documentation for this class was generated from the following file:
- /home/runner/work/esp8266ndn/NDNph/src/ndnph/keychain/ec.hpp