Enum sn_data_types::PublicKey[][src]

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.

Implementations

impl PublicKey[src]

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

Returns the bytes of the underlying public key

pub fn ed25519(&self) -> Option<PublicKey>[src]

Returns the ed25519 key, if applicable.

pub fn bls(&self) -> Option<PublicKey>[src]

Returns the BLS key, if applicable.

pub fn bls_share(&self) -> Option<PublicKeyShare>[src]

Returns the BLS key share, if applicable.

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) -> Result<String>[src]

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

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

Creates from z-base-32 encoded string.

Trait Implementations

impl Clone for PublicKey[src]

impl Copy for PublicKey[src]

impl Debug for PublicKey[src]

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

impl Display for PublicKey[src]

impl Eq for PublicKey[src]

impl From<&'_ Keypair> for PublicKey[src]

impl From<PublicKey> for PublicKey[src]

impl From<PublicKey> for PublicKey[src]

impl From<PublicKeyShare> for PublicKey[src]

impl Hash for PublicKey[src]

impl Ord for PublicKey[src]

impl PartialEq<PublicKey> for PublicKey[src]

impl PartialOrd<PublicKey> for PublicKey[src]

impl Serialize for PublicKey[src]

impl StructuralEq for PublicKey[src]

impl StructuralPartialEq for PublicKey[src]

Auto Trait Implementations

Blanket Implementations

impl<A> Actor for A where
    A: Clone + Ord + Hash
[src]

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

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

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

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

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

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

impl<T> Member for T where
    T: Clone + Eq + Hash
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,