Struct ed25519_dalek::Keypair
[−]
[src]
pub struct Keypair { pub public: PublicKey, pub secret: SecretKey, }
An ed25519 keypair.
Fields
public: PublicKey
The public half of this keypair.
secret: SecretKey
The secret half of this keypair.
Methods
impl Keypair
[src]
fn generate<T: Rng>(cspring: &mut T) -> Keypair
Generate an ed25519 keypair.
Input
A CSPRING with a fill_bytes()
method, e.g. the one returned
from rand::OsRng::new()
(in the rand
crate).
fn sign(&self, message: &[u8]) -> Signature
Sign a message with this keypair's secret key.
fn verify(&self, message: &[u8], signature: &Signature) -> bool
Verify a signature on a message with this keypair's public key.