Struct tink_core::primitiveset::PrimitiveSet[][src]

pub struct PrimitiveSet {
    pub primary: Option<Entry>,
    pub entries: HashMap<Vec<u8>, Vec<Entry>>,
}
Expand description

PrimitiveSet is used for supporting key rotation: primitives in a set correspond to keys in a keyset. Users will usually work with primitive instances, which essentially wrap primitive sets. For example an instance of an AEAD-primitive for a given keyset holds a set of AEAD-primitives corresponding to the keys in the keyset, and uses the set members to do the actual crypto operations: to encrypt data the primary AEAD-primitive from the set is used, and upon decryption the ciphertext’s prefix determines the id of the primitive from the set.

PrimitiveSet is public to allow its use in implementations of custom primitives.

Fields

primary: Option<Entry>entries: HashMap<Vec<u8>, Vec<Entry>>

Implementations

Return an empty instance of PrimitiveSet.

Return all primitives in the set that have RAW prefix.

Return all primitives in the set that have the given prefix.

Create a new entry in the primitive set and returns a copy of the added entry.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Convert an untyped PrimitiveSet into a TypedPrimitiveSet. This will panic if any of the primitives are not of the correct type.

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

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.