pub struct KeyPair { /* private fields */ }
Expand description

Wrapper for holding a public/private key pair and encrypting/decrypting messages.

Implementations

Create a new key pair and wrap it in a KeyPair.

Create a new key pair from an existing private key.

The private key is consumed and transferred into the KeyPair.

Create a new key pair from an existing public and private key.

The two keys are consumed and transferred into the KeyPair.

Return a reference to the public key.

Return the public key as hex-encoded string.

Return a reference to the private key.

Warning: Be careful with this! The only reason to access the private key is probably to be able to restore it when working with trusted keys.

Return the private key as hex-encoded string.

Warning: Be careful with this! The only reason to access the private key is probably to be able to restore it when working with trusted keys.

Trait Implementations

Implementation required because Debug is not implemented for PrivateKey.

Formats the value using the given formatter. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
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.
Get the TypeId of this object.