pub struct Ed25519SecretKey(_);
Expand description

An Ed25519 secret key, used to create digital signatures.

Implementations

Create a new random Ed25519SecretKey.

Get the byte representation of the secret key.

Try to create a Ed25519SecretKey from a slice of bytes.

Convert the secret key to a base64 encoded string.

This can be useful if the secret key needs to be sent over the network or persisted.

Warning: The string should be zeroized after it has been used, otherwise an unintentional copy of the key might exist in memory.

Try to create a Ed25519SecretKey from a base64 encoded string.

Get the public key that matches this Ed25519SecretKey.

Sign the given slice of bytes with this Ed25519SecretKey.

The signature can be verified using the public key.

Examples
use vodozemac::{Ed25519SecretKey, Ed25519PublicKey};

let secret = Ed25519SecretKey::new();
let message = "It's dangerous to go alone";

let signature = secret.sign(message.as_bytes());

let public_key = secret.public_key();

public_key.verify(message.as_bytes(), &signature).expect("The signature has to be valid");

Trait Implementations

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.