Skip to main content

AeadKey

Struct AeadKey 

Source
pub struct AeadKey<N: ArrayLength>(/* private fields */);
Expand description

An Aead key.

Implementations§

Source§

impl<N: ArrayLength> AeadKey<N>

Source

pub const fn new(key: SecretKeyBytes<N>) -> Self

Creates a new raw key.

Source

pub const fn len(&self) -> usize

Returns the length in bytes of the key.

Will always be exactly N.

Source

pub const fn as_slice(&self) -> &[u8]

Returns the raw key bytes.

Source

pub const fn as_bytes(&self) -> &SecretKeyBytes<N>

Returns the raw key bytes.

Source

pub fn into_bytes(self) -> SecretKeyBytes<N>

Converts the key into its raw key bytes.

Trait Implementations§

Source§

impl<N: Clone + ArrayLength> Clone for AeadKey<N>

Source§

fn clone(&self) -> AeadKey<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: ArrayLength> ConstantTimeEq for AeadKey<N>

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl<N: ArrayLength> Debug for AeadKey<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N: ArrayLength> Drop for AeadKey<N>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<N> Expand for AeadKey<N>

Source§

type Size = N

The size in octets of the derived key.
Source§

fn expand_multi<'a, K, I>( prk: &Prk<K::PrkSize>, info: I, ) -> Result<Self, KdfError>
where K: Kdf, I: IntoIterator<Item = &'a [u8]>, I::IntoIter: Clone,

Derives itself from a PRk.
Source§

fn expand<K: Kdf>(prk: &Prk<K::PrkSize>, info: &[u8]) -> Result<Self, KdfError>

Derives itself from a PRK.
Source§

impl<N: ArrayLength> Import<&[u8]> for AeadKey<N>

Source§

fn import(data: &[u8]) -> Result<Self, ImportError>

Creates itself from its encoding.
Source§

impl<N, const U: usize> Import<[u8; U]> for AeadKey<N>
where N: ArrayLength, Const<U>: IntoArrayLength<ArrayLength = N>,

Source§

fn import(key: [u8; U]) -> Result<Self, ImportError>

Creates itself from its encoding.
Source§

impl<N: ArrayLength> Random for AeadKey<N>

Source§

fn random<R: Csprng>(rng: R) -> Self

Generates a random instance of itself.
Source§

impl<N: ArrayLength> RawSecretBytes for AeadKey<N>

Source§

fn raw_secret_bytes(&self) -> &[u8]

Returns the secret’s byte encoding.
Source§

impl<N: ArrayLength> SecretKey for AeadKey<N>

Source§

type Size = N

The size in octets of the key.
Source§

fn try_export_secret(&self) -> Result<SecretKeyBytes<Self::Size>, ExportError>

Attempts to export the key’s secret data.
Source§

impl<N: ArrayLength> ZeroizeOnDrop for AeadKey<N>

Auto Trait Implementations§

§

impl<N> Freeze for AeadKey<N>
where <N as ArrayLength>::ArrayType<u8>: Freeze,

§

impl<N> RefUnwindSafe for AeadKey<N>

§

impl<N> Send for AeadKey<N>

§

impl<N> Sync for AeadKey<N>

§

impl<N> Unpin for AeadKey<N>
where <N as ArrayLength>::ArrayType<u8>: Unpin,

§

impl<N> UnwindSafe for AeadKey<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V