pub enum KeyPair {
    Ed25519(Keypair),
    Rsa(Keypair),
    Secp256k1(Keypair),
}

Variants

Ed25519(Keypair)

An Ed25519 keypair.

Rsa(Keypair)

An RSA keypair.

Secp256k1(Keypair)

A Secp256k1 keypair.

Implementations

Generate a new Ed25519 keypair.

Generate a new Secp256k1 keypair.

Decode an keypair from a DER-encoded secret key in PKCS#8 PrivateKeyInfo format (i.e. unencrypted) as defined in RFC5208.

Decode a keypair from a DER-encoded Secp256k1 secret key in an ECPrivateKey structure as defined in RFC5915.

Sign a message using the private key of this keypair, producing a signature that can be verified using the corresponding public key.

Get the public key of this keypair.

Verify the signature on a message using the public key.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.