Enum fluence_identity::key_pair::KeyFormat[][src]

pub enum KeyFormat {
    Ed25519,
    Rsa,
    Secp256k1,
}

Identity keypair of a node.

Example: Generating RSA keys with OpenSSL

openssl genrsa -out private.pem 2048
openssl pkcs8 -in private.pem -inform PEM -topk8 -out private.pk8 -outform DER -nocrypt
rm private.pem      # optional

Loading the keys:

let mut bytes = std::fs::read("private.pk8").unwrap();
let keypair = Keypair::rsa_from_pkcs8(&mut bytes);

Variants

Ed25519
Rsa
Secp256k1

Trait Implementations

impl FromStr for KeyFormat[src]

type Err = Error

The associated error which can be returned from parsing.

impl TryFrom<u8> for KeyFormat[src]

type Error = DecodingError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,