Enum casper_types::crypto::SecretKey[][src]

pub enum SecretKey {
    System,
    Ed25519(SecretKey),
    Secp256k1(SecretKey),
}

A secret or private asymmetric key.

Variants

System

System secret key.

Ed25519(SecretKey)

Ed25519 secret key.

Secp256k1(SecretKey)

secp256k1 secret key.

Implementations

impl SecretKey[src]

pub const SYSTEM_LENGTH: usize[src]

The length in bytes of a system secret key.

pub const ED25519_LENGTH: usize[src]

The length in bytes of an Ed25519 secret key.

pub const SECP256K1_LENGTH: usize[src]

The length in bytes of a secp256k1 secret key.

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

Constructs a new Ed25519 variant from a byte array.

pub fn secp256k1(bytes: [u8; 32]) -> Self[src]

Constructs a new secp256k1 variant from a byte array.

pub fn as_slice(&self) -> &[u8]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Exposes the secret values of the key as a byte slice.

Trait Implementations

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

impl AsymmetricType for SecretKey[src]

impl Clone for SecretKey[src]

impl DataSize for SecretKey[src]

impl Debug for SecretKey[src]

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

impl Display for SecretKey[src]

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

impl From<SecretKey> for PublicKey[src]

impl FromBytes for SecretKey[src]

impl Serialize for SecretKey[src]

impl Tagged<u8> for SecretKey[src]

impl ToBytes for SecretKey[src]

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

type Output = T

Should always be Self

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