Struct saltyrtc_client::crypto::KeyPair[][src]

pub struct KeyPair { /* fields omitted */ }

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

Methods

impl KeyPair
[src]

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

Panics

This may panic if libsodium initialization fails.

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

impl Debug for KeyPair
[src]

Formats the value using the given formatter. Read more

impl PartialEq for KeyPair
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for KeyPair
[src]

Auto Trait Implementations

impl Send for KeyPair

impl Sync for KeyPair