Skip to main content

RustCryptoEd25519Ext

Trait RustCryptoEd25519Ext 

Source
pub trait RustCryptoEd25519Ext {
    // Required methods
    fn ed25519_signing_key(&self) -> SigningKey;
    fn ed25519_verifying_key(&self) -> VerifyingKey;
}
Expand description

Extension trait to convert uselesskey Ed25519 fixtures into ed25519-dalek types.

§Examples

use uselesskey_core::Factory;
use uselesskey_ed25519::{Ed25519FactoryExt, Ed25519Spec};
use uselesskey_rustcrypto::RustCryptoEd25519Ext;
use ed25519_dalek::{Signer, Verifier};

let fx = Factory::random();
let keypair = fx.ed25519("my-service", Ed25519Spec::new());

let signing_key = keypair.ed25519_signing_key();
let signature = signing_key.sign(b"hello");

let verifying_key = keypair.ed25519_verifying_key();
verifying_key.verify(b"hello", &signature).unwrap();

Required Methods§

Source

fn ed25519_signing_key(&self) -> SigningKey

Convert the Ed25519 fixture to an ed25519_dalek::SigningKey.

Source

fn ed25519_verifying_key(&self) -> VerifyingKey

Derive the ed25519_dalek::VerifyingKey from the fixture.

Implementations on Foreign Types§

Source§

impl RustCryptoEd25519Ext for Ed25519KeyPair

Available on crate feature ed25519 only.

Implementors§