Skip to main content

OrderKeyInit

Trait OrderKeyInit 

Source
pub trait OrderKeyInit: OrderScheme + Sized {
    type Key: Controlled;
    type KeyError: Error + Send + Sync + 'static;

    // Required methods
    fn new(key: Self::Key) -> Self;
    fn try_from_bytes(key: Protected<Vec<u8>>) -> Result<Self, Self::KeyError>;
}
Expand description

A scheme keyed from secret bytes, as PrfKeyInit keys a PRF, so an index layer can construct any scheme the same way.

Required Associated Types§

Source

type Key: Controlled

The scheme’s full-strength key, a protected array.

Source

type KeyError: Error + Send + Sync + 'static

Why key material of a length only known at runtime was refused.

Required Methods§

Source

fn new(key: Self::Key) -> Self

Key the scheme with a full-strength key. Cannot fail: the type carries the length.

Source

fn try_from_bytes(key: Protected<Vec<u8>>) -> Result<Self, Self::KeyError>

Key the scheme with material whose length is only known at runtime, such as a KMS response.

§Errors

KeyError if the material is unfit, a short key say. Accepting it would produce terms anyone can order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§