[][src]Enum casper_node::crypto::asymmetric_key::Signature

pub enum Signature {
    Ed25519([u8; 64]),
    Secp256k1(Secp256k1Signature),
}

A signature of given data.

Variants

Ed25519([u8; 64])

Ed25519 signature.

secp256k1 signature.

Implementations

impl Signature[src]

pub const ED25519_LENGTH: usize[src]

The length in bytes of an Ed25519 signature,

pub const SECP256K1_LENGTH: usize[src]

The length in bytes of a secp256k1 signature

pub fn new_ed25519(bytes: [u8; 64]) -> Result<Self>[src]

Constructs a new Ed25519 variant from a byte array.

pub fn new_secp256k1(bytes: [u8; 64]) -> Result<Self>[src]

Constructs a new secp256k1 variant from a byte array.

pub fn ed25519_from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self>[src]

Constructs a new Ed25519 variant from a byte slice.

pub fn secp256k1_from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self>[src]

Constructs a new secp256k1 variant from a byte slice.

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

Converts the signature to hex, where the first byte represents the algorithm tag.

pub fn from_hex<T: AsRef<[u8]>>(input: T) -> Result<Self>[src]

Tries to decode a signature from its hex-representation. The hex format should be as produced by Signature::to_hex().

Trait Implementations

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

impl Clone for Signature[src]

impl Copy for Signature[src]

impl DataSize for Signature where
    [u8; 64]: DataSize
[src]

impl Debug for Signature[src]

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

impl Display for Signature[src]

impl Eq for Signature[src]

impl Hash for Signature[src]

impl Ord for Signature[src]

impl PartialEq<Signature> for Signature[src]

impl PartialOrd<Signature> for Signature[src]

impl Serialize for Signature[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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> RuleType for T where
    T: Eq + Ord + Copy + Debug + Hash
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

impl<T> WithSubscriber for T[src]