Struct mundane::public::ed25519::Ed25519Signature

source ·
pub struct Ed25519Signature { /* private fields */ }
Expand description

An Ed25519 signature.

Implementations§

source§

impl Ed25519Signature

source

pub fn from_bytes(bytes: [u8; 64]) -> Ed25519Signature

Constructs an Ed25519Signature signature from raw bytes.

source

pub fn bytes(&self) -> &[u8; 64]

Gets the raw bytes of the signature.

source

pub fn sign_ed25519(key: &Ed25519PrivKey, message: &[u8]) -> Ed25519Signature

Sign a message.

Ed25519Signature implements Signature, but Signature’s sign function conservatively returns a Result. Ed25519 signatures never fail, so this function is provided to allow the user to compute an Ed25519 signature without having to perform error checking.

Trait Implementations§

source§

impl Debug for Ed25519Signature

source§

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

Formats the value using the given formatter. Read more
source§

impl Signature for Ed25519Signature

source§

fn sign(key: &Ed25519PrivKey, message: &[u8]) -> Result<Ed25519Signature, Error>

Sign a message.

Though the Signature trait requires that sign return a Result, Ed25519Signature’s implementation is guaranteed to always return Ok. Callers may prefer the sign_ed25519 function, which returns an Ed25519Signature rather than a Result.

§

type PrivateKey = Ed25519PrivKey

The private key type used to generate this signature.
source§

fn is_valid(&self, key: &Ed25519PubKey, message: &[u8]) -> bool

Verify a signature. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.