Struct ring::aead::less_safe_key::LessSafeKey
source · pub struct LessSafeKey {
inner: KeyInner,
algorithm: &'static Algorithm,
}
Expand description
Immutable keys for use in situations where OpeningKey
/SealingKey
and
NonceSequence
cannot reasonably be used.
Prefer to use OpeningKey
/SealingKey
and NonceSequence
when practical.
Fields§
§inner: KeyInner
§algorithm: &'static Algorithm
Implementations§
source§impl LessSafeKey
impl LessSafeKey
sourcepub fn new(key: UnboundKey) -> Self
pub fn new(key: UnboundKey) -> Self
Constructs a LessSafeKey
.
pub(super) fn new_( algorithm: &'static Algorithm, key_bytes: &[u8], ) -> Result<Self, Unspecified>
sourcepub fn open_in_place_separate_tag<'in_out, A>(
&self,
nonce: Nonce,
aad: Aad<A>,
tag: Tag,
in_out: &'in_out mut [u8],
ciphertext: RangeFrom<usize>,
) -> Result<&'in_out mut [u8], Unspecified>
pub fn open_in_place_separate_tag<'in_out, A>( &self, nonce: Nonce, aad: Aad<A>, tag: Tag, in_out: &'in_out mut [u8], ciphertext: RangeFrom<usize>, ) -> Result<&'in_out mut [u8], Unspecified>
Like open_in_place, except the authentication tag is passed separately.
sourcepub fn open_in_place<'in_out, A>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &'in_out mut [u8],
) -> Result<&'in_out mut [u8], Unspecified>
pub fn open_in_place<'in_out, A>( &self, nonce: Nonce, aad: Aad<A>, in_out: &'in_out mut [u8], ) -> Result<&'in_out mut [u8], Unspecified>
Like super::OpeningKey::open_in_place()
, except it accepts an
arbitrary nonce.
nonce
must be unique for every use of the key to open data.
sourcepub fn open_within<'in_out, A>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &'in_out mut [u8],
ciphertext_and_tag: RangeFrom<usize>,
) -> Result<&'in_out mut [u8], Unspecified>
pub fn open_within<'in_out, A>( &self, nonce: Nonce, aad: Aad<A>, in_out: &'in_out mut [u8], ciphertext_and_tag: RangeFrom<usize>, ) -> Result<&'in_out mut [u8], Unspecified>
Like super::OpeningKey::open_within()
, except it accepts an
arbitrary nonce.
nonce
must be unique for every use of the key to open data.
sourcepub fn seal_in_place_append_tag<A, InOut>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut InOut,
) -> Result<(), Unspecified>
pub fn seal_in_place_append_tag<A, InOut>( &self, nonce: Nonce, aad: Aad<A>, in_out: &mut InOut, ) -> Result<(), Unspecified>
Like super::SealingKey::seal_in_place_append_tag()
, except it
accepts an arbitrary nonce.
nonce
must be unique for every use of the key to seal data.
sourcepub fn seal_in_place_separate_tag<A>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut [u8],
) -> Result<Tag, Unspecified>
pub fn seal_in_place_separate_tag<A>( &self, nonce: Nonce, aad: Aad<A>, in_out: &mut [u8], ) -> Result<Tag, Unspecified>
Like super::SealingKey::seal_in_place_separate_tag()
, except it
accepts an arbitrary nonce.
nonce
must be unique for every use of the key to seal data.
pub(super) fn fmt_debug( &self, type_name: &'static str, f: &mut Formatter<'_>, ) -> Result<(), Error>
Trait Implementations§
source§impl Clone for LessSafeKey
impl Clone for LessSafeKey
source§fn clone(&self) -> LessSafeKey
fn clone(&self) -> LessSafeKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for LessSafeKey
impl RefUnwindSafe for LessSafeKey
impl Send for LessSafeKey
impl Sync for LessSafeKey
impl Unpin for LessSafeKey
impl UnwindSafe for LessSafeKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)