Struct dryoc::keypair::KeyPair

source ·
pub struct KeyPair<PublicKey: ByteArray<CRYPTO_BOX_PUBLICKEYBYTES>, SecretKey: ByteArray<CRYPTO_BOX_SECRETKEYBYTES>> {
    pub public_key: PublicKey,
    pub secret_key: SecretKey,
}
Expand description

Public/private keypair for use with crate::dryocbox::DryocBox, aka libsodium box

Fields

public_key: PublicKey

Public key

secret_key: SecretKey

Secret key

Implementations

Available on crate feature nightly only.

Returns a new locked keypair.

Available on crate feature nightly only.

Returns a new randomly generated locked keypair.

Available on crate feature nightly only.

Returns a new randomly generated locked, read-only keypair.

Creates a new, empty keypair.

Generates a random keypair.

Derives a keypair from secret_key, and consumes it, and returns a new keypair.

Derives a keypair from seed, returning a new keypair.

Randomly generates a new keypair, using default types (stack-allocated byte arrays). Provided for convenience.

Constructs a new keypair from key slices, consuming them. Does not check validity or authenticity of keypair.

Creates new client session keys using this keypair and server_public_key, assuming this keypair is for the client.

Creates new server session keys using this keypair and client_public_key, assuming this keypair is for the server.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more
Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.