[][src]Trait enr::EnrPublicKey

pub trait EnrPublicKey {
    fn verify_v4(&self, msg: &[u8], sig: &[u8]) -> bool;
fn encode(&self) -> Vec<u8>;
fn encode_uncompressed(&self) -> Vec<u8>;
fn enr_key(&self) -> String; }

The trait required for a PublicKey to verify an ENR record.

Required methods

fn verify_v4(&self, msg: &[u8], sig: &[u8]) -> bool

Verify an ENR signature for the v4 identity scheme.

fn encode(&self) -> Vec<u8>

Encodes the public key to bytes in compressed form, if possible.

fn encode_uncompressed(&self) -> Vec<u8>

Encodes the public key in uncompressed form.

fn enr_key(&self) -> String

Returns the ENR key identifier for the public key type. For secp256k1 keys this is secp256k1.

Loading content...

Implementations on Foreign Types

impl EnrPublicKey for PublicKey[src]

fn verify_v4(&self, msg: &[u8], sig: &[u8]) -> bool[src]

Verify a raw message, given a public key for the v4 identity scheme.

fn encode(&self) -> Vec<u8>[src]

Encodes the public key into compressed form, if possible.

fn encode_uncompressed(&self) -> Vec<u8>[src]

Encodes the public key in uncompressed form. This is the same as the compressed form for ed25519 keys

fn enr_key(&self) -> String[src]

Generates the ENR public key string associated with the ed25519 key type.

impl EnrPublicKey for PublicKey[src]

fn verify_v4(&self, msg: &[u8], sig: &[u8]) -> bool[src]

Verify a raw message, given a public key for the v4 identity scheme.

fn encode(&self) -> Vec<u8>[src]

Encodes the public key into compressed form, if possible.

fn encode_uncompressed(&self) -> Vec<u8>[src]

Encodes the public key in uncompressed form.

fn enr_key(&self) -> String[src]

Generates the ENR public key string associated with the secp256k1 key type.

impl EnrPublicKey for PublicKey[src]

Loading content...

Implementors

impl EnrPublicKey for CombinedPublicKey[src]

fn verify_v4(&self, msg: &[u8], sig: &[u8]) -> bool[src]

Verify a raw message, given a public key for the v4 identity scheme.

fn encode(&self) -> Vec<u8>[src]

Encodes the public key into compressed form, if possible.

fn encode_uncompressed(&self) -> Vec<u8>[src]

Encodes the public key in uncompressed form.

fn enr_key(&self) -> String[src]

Generates the ENR public key string associated with the key type.

Loading content...