Skip to main content

PublicId

Trait PublicId 

Source
pub trait PublicId:
    Clone
    + Eq
    + Ord
    + Hash
    + Serialize
    + DeserializeOwned
    + Debug {
    type Signature: Clone + Eq + Ord + Hash + Serialize + DeserializeOwned + Debug;

    // Required method
    fn verify_signature(&self, signature: &Self::Signature, data: &[u8]) -> bool;
}
Expand description

The public identity of a node. It provides functionality to allow it to be used as an asymmetric signing public key.

Required Associated Types§

Source

type Signature: Clone + Eq + Ord + Hash + Serialize + DeserializeOwned + Debug

The signature type associated with the chosen asymmetric key scheme.

Required Methods§

Source

fn verify_signature(&self, signature: &Self::Signature, data: &[u8]) -> bool

Verifies signature against data using this PublicId. Returns true if valid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§