[−][src]Struct ring::aead::SealingKey
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]
&mut self,
Aad: Aad<A>,
in_out: &mut [u8],
out_suffix_capacity: usize
) -> Result<usize, Unspecified>
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]
fn new(key: UnboundKey, nonce_sequence: N) -> Self
[src]
fn algorithm(&self) -> &'static Algorithm
[src]
impl<N: NonceSequence> Debug for SealingKey<N>
[src]
Auto Trait Implementations
impl<N> Unpin for SealingKey<N> where
N: Unpin,
N: Unpin,
impl<N> Send for SealingKey<N> where
N: Send,
N: Send,
impl<N> Sync for SealingKey<N> where
N: Sync,
N: Sync,
impl<N> RefUnwindSafe for SealingKey<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> UnwindSafe for SealingKey<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,