Enum tendermint::public_key::PublicKey[][src]

#[non_exhaustive]pub enum PublicKey {
    Ed25519(Ed25519),
    Secp256k1(Secp256k1),
}

Public keys allowed in Tendermint protocols

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ed25519(Ed25519)

Ed25519 keys

Secp256k1(Secp256k1)
This is supported on crate feature secp256k1 only.

Secp256k1 keys

Implementations

impl PublicKey[src]

pub fn from_raw_secp256k1(bytes: &[u8]) -> Option<PublicKey>[src]

This is supported on crate feature secp256k1 only.

From raw secp256k1 public key bytes

pub fn from_raw_ed25519(bytes: &[u8]) -> Option<PublicKey>[src]

From raw Ed25519 public key bytes

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

Get Ed25519 public key

pub fn secp256k1(self) -> Option<Secp256k1>[src]

This is supported on crate feature secp256k1 only.

Get Secp256k1 public key

pub fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), Error>[src]

Verify the given Signature using this public key

pub fn as_bytes(&self) -> &[u8][src]

View this key as a byte slice

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

Get a vector containing the byte serialization of this key

pub fn to_bech32(self, hrp: &str) -> String[src]

Serialize this key as Bech32 with the given human readable prefix

pub fn to_hex(self) -> String[src]

Serialize this key as hexadecimal

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 Eq for PublicKey[src]

impl From<EncodedPoint<Secp256k1>> for PublicKey[src]

impl From<PublicKey> for PublicKey[src]

impl From<PublicKey> for Id[src]

impl Ord for PublicKey[src]

impl PartialEq<PublicKey> for PublicKey[src]

impl PartialOrd<PublicKey> for PublicKey[src]

impl Protobuf<PublicKey> for PublicKey[src]

impl Serialize for PublicKey[src]

impl StructuralEq for PublicKey[src]

impl StructuralPartialEq for PublicKey[src]

impl TryFrom<PublicKey> for PublicKey[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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> Conv for T

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

impl<T> FmtForward for T

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

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>,