Struct ruma::signatures::Ed25519KeyPair [−][src]
pub struct Ed25519KeyPair { /* fields omitted */ }
signatures
only.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
pub fn from_pkcs8_oak(
oak: PrivateKeyInfo<'_>,
version: String
) -> Result<Ed25519KeyPair, Error>
pub fn from_pkcs8_oak(
oak: PrivateKeyInfo<'_>,
version: String
) -> Result<Ed25519KeyPair, Error>
Constructs a key pair from [pkcs8::PrivateKeyInfo
].
pub fn from_pkcs8_pki(
oak: PrivateKeyInfo<'_>,
version: String
) -> Result<Ed25519KeyPair, Error>
pub fn from_pkcs8_pki(
oak: PrivateKeyInfo<'_>,
version: String
) -> Result<Ed25519KeyPair, Error>
Constructs a key pair from [pkcs8::PrivateKeyInfo
].
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Ed25519KeyPair
impl Send for Ed25519KeyPair
impl Sync for Ed25519KeyPair
impl Unpin for Ed25519KeyPair
impl UnwindSafe for Ed25519KeyPair
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
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