Struct ruma_signatures::Ed25519KeyPair [−][src]
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
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
impl RefUnwindSafe for Ed25519KeyPair
impl Send for Ed25519KeyPair
impl Sync for Ed25519KeyPair
impl Unpin for Ed25519KeyPair
impl UnwindSafe for Ed25519KeyPair
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,