cardano::ed25519::PublicKey class

Represent an Ed25519 prublic key.

Derived classes

class cardano::VRFPublicKey
Represents a VRF public key.

Constructors, destructors, conversion operators

PublicKey(std::span<const uint8_t, PUBLIC_KEY_SIZE> pub) explicit
Construct a key object from a span of key bytes.

Public functions

auto bytes() const →  const PubKeyByteArray& constexpr
Return a constant reference to the public key byte array.
auto verifySignature(std::span<const uint8_t> msg, std::span<const uint8_t, SIGNATURE_SIZE> sig) const →  bool
Verify a signature using the public key.

Function documentation

cardano::ed25519::PublicKey::PublicKey(std::span<const uint8_t, PUBLIC_KEY_SIZE> pub) explicit

Construct a key object from a span of key bytes.

Parameters
pub An array of 32 bytes that will be copied into the object.

bool cardano::ed25519::PublicKey::verifySignature(std::span<const uint8_t> msg, std::span<const uint8_t, SIGNATURE_SIZE> sig) const

Verify a signature using the public key.

Parameters
msg A span of bytes (uint8_t) representing the original message.
sig A span of 64 bytes (uint8_t) representing the signature.