[][src]Enum safe_nd::PublicKey

pub enum PublicKey {
    Ed25519(PublicKey),
    Bls(PublicKey),
    BlsShare(PublicKeyShare),
}

Wrapper for different public key types.

Variants

Ed25519(PublicKey)

Ed25519 public key.

BLS public key.

BlsShare(PublicKeyShare)

BLS public key share.

Methods

impl PublicKey[src]

pub fn verify<T: AsRef<[u8]>>(
    &self,
    signature: &Signature,
    data: T
) -> Result<()>
[src]

Returns Ok(()) if signature matches the message and Err(Error::InvalidSignature) otherwise.

pub fn encode_to_zbase32(&self) -> String[src]

Returns the PublicKey serialised and encoded in z-base-32.

pub fn decode_from_zbase32<I: Decodable>(encoded: I) -> Result<Self>[src]

Creates from z-base-32 encoded string.

Trait Implementations

impl Eq for PublicKey[src]

impl Clone for PublicKey[src]

impl PartialOrd<PublicKey> for PublicKey[src]

impl PartialEq<PublicKey> for PublicKey[src]

impl Ord for PublicKey[src]

impl From<PublicKey> for XorName[src]

impl From<PublicKey> for PublicKey[src]

impl From<PublicKey> for PublicKey[src]

impl From<PublicKeyShare> for PublicKey[src]

impl Copy for PublicKey[src]

impl Hash for PublicKey[src]

impl Debug for PublicKey[src]

impl Display for PublicKey[src]

impl Serialize for PublicKey[src]

impl<'de> Deserialize<'de> for PublicKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self