pub struct Config {
    pub aead: Aead,
    pub kdf: Kdf,
    pub kem: Kem,
}
Expand description

Config is an open struct that contains an (Aead, Kdf, Kem) algorithmic triple. This can be used with Config::base_mode_seal, Config::base_mode_open, [base_mode_seal], or [base_mode_open].

Fields

aead: Aeadkdf: Kdf

the key derivation function to be used

kem: Kem

Implementations

base_mode_seal provides an interface to hpke::single_shot_seal that does not require compile time selection of an algorithm. Instead, the selected algorithm is provided through the Config that this method is called on.

Requires the base-mode-seal crate feature to be enabled.

Errors

This will return an Result::Err variant if:

  • we are unable to deserialize the recipient public key
  • there is an error in key encapsultion
  • there is an error in encryption

base_mode_open provides an interface to hpke::single_shot_open that does not require compile time selection of an algorithm. Instead, the selected algorithm is provided through the Config that this method is called on.

Requires the base-mode-open crate feature to be enabled.

Errors

This will return an Result::Err variant if:

  • we are unable to deserialize the private key or encapsulated key
  • there is an error in key decapsulation
  • there is an error in decryption

Attempt to convert three u16 ids into a valid config. The id mappings are defined in the draft.

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

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

This method tests for !=.

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

🔬 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.