logo
pub struct Ed25519KeyPair { /* private fields */ }
Expand description

An Ed25519 key pair.

Implementations

Create a key pair from its constituent parts.

Initializes a new key pair.

Parameters
  • document: PKCS#8 v1/v2 DER-formatted document containing the private (and optionally public) key.
  • 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.

Returns an error when the PKCS#8 document had a public key, but it doesn’t match the one generated from the private key. This is a fallback and extra validation against corruption or

Constructs a key pair from pkcs8::PrivateKeyInfo.

Constructs a key pair from pkcs8::PrivateKeyInfo.

Generates a new key pair.

Returns

Returns a Vec representing a DER-encoded PKCS#8 v2 document (with public key)

Errors

Returns an error if the generation failed.

Returns the version string for this keypair.

Returns the public key.

Trait Implementations

Formats the value using the given formatter. Read more

Signs a JSON object. 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more