Enum world_id::Keypair
[−]
[src]
pub enum Keypair { Ed25519(Vec<u8>), }
The type of a keypair. Right now, only ED25519 is supported, but paranoia dictates that we allow room for expansion.
Variants
Ed25519(Vec<u8>)
Methods
impl Keypair
[src]
pub fn new() -> Result<Keypair, Error>
[src]
Generates and returns a new public+private key pair.
pub fn save_to_pem<W: Write>(&self, stream: &mut W) -> Result<(), Error>
[src]
Saves the keypair to the given Write
stream as a PEM file
encoded as a PKCS8 #2 document..
Contains both the public and private key? :/ Seems like you
should be able to have them separate.
pub fn load_from_pem<R: Read>(data: &mut R) -> Result<Self, Error>
[src]
pub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, Error>
[src]
Signs the given message with the keypair's private key.
Trait Implementations
impl Clone for Keypair
[src]
fn clone(&self) -> Keypair
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Keypair
[src]
fn eq(&self, __arg_0: &Keypair) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Keypair) -> bool
[src]
This method tests for !=
.
impl Eq for Keypair
[src]
impl Debug for Keypair
[src]
Doesn't derive debug to avoid leaking the key to console quite as easily. XD Instead has a custom debug method that just prints out the keypair type.