[][src]Struct rust_ipv8::crypto::signature::KeyPair

pub struct KeyPair(pub Ed25519KeyPair);

Wrapper struct containing an Ed25519 Key Pair

Methods

impl KeyPair[src]

pub fn new() -> Result<Self, Box<dyn Error>>[src]

Generates a new random keypair

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>[src]

Constructs a keypair from a bytearray containing data in the pkcs8 format

pub fn from_seed_checked(
    seed: &[u8; 32],
    publickey: &Ed25519PublicKey
) -> Result<Self, Box<dyn Error>>
[src]

Creates a keypair with the provided and seed and checks if the generated key matches the given public key

pub fn public_key(&self) -> Result<Ed25519PublicKey, Box<dyn Error>>[src]

Returns the Public part of the KeyPair

Auto Trait Implementations

impl Unpin for KeyPair

impl Sync for KeyPair

impl Send for KeyPair

impl RefUnwindSafe for KeyPair

impl UnwindSafe for KeyPair

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]