EC public key.
More...
#include <ec.hpp>
Inherits ndnph::detail::NamedPublicKey< SigType::Sha256WithEcdsa >.
|
| operator bool () const |
| Determine if this key is non-empty.
|
|
bool | import (const Name &name, const uint8_t raw[KeyLen::value]) |
| Import from raw key bits.
|
|
bool | import (Region ®ion, const Data &data) |
| Import a public key from certificate.
|
|
template<typename Signer > |
Data::Signed | buildCertificate (Region ®ion, const Name &name, const ValidityPeriod &validity, const Signer &signer) const |
| Generate certificate of this public key.
|
|
template<typename Signer > |
Data::Signed | selfSign (Region ®ion, const ValidityPeriod &validity, const Signer &signer) const |
| Generate self-signed certificate of this public key.
|
|
bool | verify (std::initializer_list< tlv::Value > chunks, const uint8_t *sig, size_t sigLen) const final |
| Perform verification.
|
|
bool | matchSigInfo (const SigInfo &sigInfo) const override |
| Determine whether packet was signed by corresponding private key.
|
|
virtual | ~PublicKey ()=default |
|
const Name & | getName () const |
| Retrieve KeyLocator name.
|
|
void | setName (const Name &v) |
| Assign KeyLocator name.
|
|
◆ 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