Struct ruma_signatures::Ed25519KeyPair[][src]

pub struct Ed25519KeyPair { /* fields omitted */ }

An Ed25519 key pair.

Implementations

impl Ed25519KeyPair[src]

pub fn new(document: &[u8], version: String) -> Result<Self, Error>[src]

Initializes a new key pair.

Parameters

  • document: PKCS8-formatted bytes containing the private & public keys.
  • version: The “version” of the key used for this signature. Versions are used as an identifier to distinguish signatures generated from different keys but using the same algorithm on the same homeserver.

Errors

Returns an error if the public and private keys provided are invalid for the implementing algorithm.

pub fn generate() -> Result<Vec<u8>, Error>[src]

Generates a new key pair.

Returns

Returns a Vec representing a pkcs8-encoded private/public keypair

Errors

Returns an error if the generation failed.

pub fn version(&self) -> &str[src]

Returns the version string for this keypair.

pub fn public_key(&self) -> &[u8][src]

Returns the public key.

Trait Implementations

impl Debug for Ed25519KeyPair[src]

impl KeyPair for Ed25519KeyPair[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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.