Enum casper_types::crypto::PublicKey[][src]

pub enum PublicKey {
    System,
    Ed25519(PublicKey),
    Secp256k1([u8; 33]),
}

A public asymmetric key.

Variants

System

System public key.

Ed25519(PublicKey)

Ed25519 public key.

Secp256k1([u8; 33])

secp256k1 public key.

Implementations

impl PublicKey[src]

pub const SYSTEM_LENGTH: usize[src]

The length in bytes of a system public key.

pub const ED25519_LENGTH: usize[src]

The length in bytes of an Ed25519 public key.

pub const SECP256K1_LENGTH: usize[src]

The length in bytes of a secp256k1 public key.

pub fn ed25519(bytes: [u8; 32]) -> Result<Self, Error>[src]

Constructs a new Ed25519 variant from a byte array.

pub fn secp256k1(bytes: [u8; 33]) -> Result<Self, Error>[src]

Constructs a new secp256k1 variant from a byte array.

pub fn to_account_hash(&self) -> AccountHash[src]

Creates an AccountHash from a given PublicKey instance.

Trait Implementations

impl AsRef<[u8]> for PublicKey[src]

impl AsymmetricType for PublicKey[src]

impl CLTyped for PublicKey[src]

impl Clone for PublicKey[src]

impl Copy for PublicKey[src]

impl DataSize for PublicKey where
    [u8; 33]: DataSize
[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<&'_ PublicKey> for AccountHash[src]

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

impl From<SecretKey> for PublicKey[src]

impl FromBytes 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]

impl Tagged<u8> for PublicKey[src]

impl ToBytes for PublicKey[src]

Auto Trait Implementations

Blanket Implementations

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

impl<A, T> AsBits<T> for A where
    T: BitStore + BitMemory,
    A: AsRef<[T]>, 

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> ToHex for T where
    T: AsRef<[u8]>, 
[src]

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