Struct diem_crypto::ed25519::Ed25519PrivateKey[][src]

pub struct Ed25519PrivateKey(_);
Expand description

An Ed25519 private key

Implementations

impl Ed25519PrivateKey[src]

pub const LENGTH: usize[src]

The length of the Ed25519PrivateKey

pub fn to_bytes(&self) -> [u8; 32][src]

Serialize an Ed25519PrivateKey.

Trait Implementations

impl Debug for Ed25519PrivateKey[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
    D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Display for Ed25519PrivateKey[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<&'_ Ed25519PrivateKey> for Ed25519PublicKey[src]

fn from(private_key: &Ed25519PrivateKey) -> Self[src]

Performs the conversion.

impl From<&'_ Ed25519PrivateKey> for MultiEd25519PrivateKey[src]

Convenient method to create a MultiEd25519PrivateKey from a single Ed25519PrivateKey.

fn from(ed_private_key: &Ed25519PrivateKey) -> Self[src]

Performs the conversion.

impl Genesis for Ed25519PrivateKey[src]

fn genesis() -> Self[src]

Produces the genesis private key.

impl Length for Ed25519PrivateKey[src]

fn length(&self) -> usize[src]

The serialized length of the data

impl PartialEq<Ed25519PrivateKey> for Ed25519PrivateKey[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PrivateKey for Ed25519PrivateKey[src]

type PublicKeyMaterial = Ed25519PublicKey

We require public / private types to be coupled, i.e. their associated type is each other. Read more

fn public_key(&self) -> Self::PublicKeyMaterial[src]

Returns the associated public key

impl Serialize for Ed25519PrivateKey[src]

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl SigningKey for Ed25519PrivateKey[src]

type VerifyingKeyMaterial = Ed25519PublicKey

The associated verifying key type for this signing key.

type SignatureMaterial = Ed25519Signature

The associated signature type for this signing key.

fn sign<T: CryptoHash + Serialize>(&self, message: &T) -> Ed25519Signature[src]

Signs an object that has an distinct domain-separation hasher and that we know how to serialize. There is no pre-hashing into a HashValue to be done by the caller. Read more

fn verifying_key(&self) -> Self::VerifyingKeyMaterial[src]

Returns the associated verifying key

impl TryFrom<&'_ [u8]> for Ed25519PrivateKey[src]

fn try_from(bytes: &[u8]) -> Result<Ed25519PrivateKey, CryptoMaterialError>[src]

Deserialize an Ed25519PrivateKey. This method will also check for key validity.

type Error = CryptoMaterialError

The type returned in the event of a conversion error.

impl Uniform for Ed25519PrivateKey[src]

fn generate<R>(rng: &mut R) -> Self where
    R: RngCore + CryptoRng
[src]

Generate key material from an RNG. This should generally not be used for production purposes even with a good source of randomness. When possible use hardware crypto to generate and store private keys. Read more

fn generate_for_testing() -> Self where
    Self: Sized
[src]

Generate a random key using the shared TEST_SEED

impl ValidCryptoMaterial for Ed25519PrivateKey[src]

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

Convert the valid crypto material to bytes.

impl Eq for Ed25519PrivateKey[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

pub fn test_only_hash(&Self) -> HashValue[src]

Generates a hash used only for tests.

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

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

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> ValidCryptoMaterialStringExt for T where
    T: ValidCryptoMaterial
[src]

fn from_encoded_string(encoded_str: &str) -> Result<Self, CryptoMaterialError>[src]

When trying to convert from bytes, we simply decode the string into bytes before checking if we can convert. Read more

fn to_encoded_string(&self) -> Result<String>[src]

A function to encode into hex-string after serializing.

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