Enum safe_network::types::PublicKey
source · [−]pub enum PublicKey {
Ed25519(PublicKey),
Bls(PublicKey),
BlsShare(PublicKeyShare),
}
Expand description
Wrapper for different public key types.
Variants
Ed25519(PublicKey)
Ed25519 public key.
Bls(PublicKey)
BLS public key.
BlsShare(PublicKeyShare)
BLS public key share.
Implementations
Construct and ed25519 public key from a hex-encoded string.
It is often useful to parse such raw strings in user-facing apps like CLI
Construct and ed25519 public key from a hex-encoded string.
It is often useful to parse such raw strings in user-facing apps like CLI
Returns the bytes of the underlying public key
Returns the BLS key share, if applicable.
Returns Ok(())
if signature
matches the message and Err(Error::InvalidSignature)
otherwise.
Returns the PublicKey
serialised and encoded in z-base-32.
Creates from z-base-32 encoded string.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more