[−][src]Struct tink_core::primitiveset::PrimitiveSet
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
impl PrimitiveSet
[src]
pub fn new() -> Self
[src]
Return an empty instance of PrimitiveSet
.
pub fn raw_entries(&self) -> Vec<Entry>
[src]
Return all primitives in the set that have RAW prefix.
pub fn entries_for_prefix(&self, prefix: &[u8]) -> Vec<Entry>
[src]
Return all primitives in the set that have the given prefix.
pub fn add(&mut self, p: Primitive, key: &Key) -> Result<Entry, TinkError>
[src]
Create a new entry in the primitive set and returns a copy of the added entry.
Trait Implementations
impl Clone for PrimitiveSet
[src]
fn clone(&self) -> PrimitiveSet
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for PrimitiveSet
[src]
fn default() -> PrimitiveSet
[src]
impl<P: From<Primitive>> From<PrimitiveSet> for TypedPrimitiveSet<P>
[src]
Convert an untyped PrimitiveSet
into a TypedPrimitiveSet
. This will
panic if any of the primitives are not of the correct type.
fn from(ps: PrimitiveSet) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for PrimitiveSet
impl !Send for PrimitiveSet
impl !Sync for PrimitiveSet
impl Unpin for PrimitiveSet
impl !UnwindSafe for PrimitiveSet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,