[][src]Struct ring::aead::SealingKey

pub struct SealingKey<N: NonceSequence> { /* fields omitted */ }

An AEAD key for encrypting and signing ("sealing"), bound to a nonce sequence.

Intentionally not Clone or Copy since cloning would allow duplication of the nonce sequence.

Methods

impl<N: NonceSequence> SealingKey<N>[src]

pub fn seal_in_place<A: AsRef<[u8]>>(
    &mut self,
    Aad: Aad<A>,
    in_out: &mut [u8],
    out_suffix_capacity: usize
) -> Result<usize, Unspecified>
[src]

Encrypts and signs (“seals”) data in place.

nonce must be unique for every use of the key to seal data.

The input is in_out[..(in_out.len() - out_suffix_capacity)]; i.e. the input is the part of in_out that precedes the suffix. When seal_in_place() returns Ok(out_len), the encrypted and signed output is in_out[..out_len]; i.e. the output has been written over input and at least part of the data reserved for the suffix. (The input/output buffer is expressed this way because Rust's type system does not allow us to have two slices, one mutable and one immutable, that reference overlapping memory at the same time.)

out_suffix_capacity must be at least key.algorithm().tag_len(). See also MAX_TAG_LEN.

aad is the additional authenticated data, if any.

Trait Implementations

impl<N: NonceSequence> BoundKey<N> for SealingKey<N>[src]

impl<N: NonceSequence> Debug for SealingKey<N>[src]

Auto Trait Implementations

impl<N> Unpin for SealingKey<N> where
    N: Unpin

impl<N> Send for SealingKey<N> where
    N: Send

impl<N> Sync for SealingKey<N> where
    N: Sync

impl<N> RefUnwindSafe for SealingKey<N> where
    N: RefUnwindSafe

impl<N> UnwindSafe for SealingKey<N> where
    N: UnwindSafe

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]