aws_lc_rs::aead

Struct TlsRecordOpeningKey

Source
pub struct TlsRecordOpeningKey { /* private fields */ }
Expand description

AEAD Encryption key used for TLS protocol record encryption.

This type encapsulates decryption operations for TLS AEAD algorithms.

The following algorithms are supported:

  • AES_128_GCM
  • AES_256_GCM

Prefer this type in place of LessSafeKey, OpeningKey, SealingKey for TLS protocol implementations.

Implementations§

Source§

impl TlsRecordOpeningKey

Source

pub fn new( algorithm: &'static Algorithm, protocol: TlsProtocolId, key_bytes: &[u8], ) -> Result<Self, Unspecified>

New TLS record opening key. Only supports AES_128_GCM and AES_256_GCM Algorithms.

§Errors
  • Unspecified: Returned if the length of key_bytes does not match the chosen algorithm, or if an unsupported algorithm is provided.
Source

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>
where A: AsRef<[u8]>,

See super::OpeningKey::open_in_place() for details.

§Errors

error::Unspecified when ciphertext is invalid.

Source

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>
where A: AsRef<[u8]>,

See super::OpeningKey::open_within() for details.

§Errors

error::Unspecified when ciphertext is invalid.

Source

pub fn algorithm(&self) -> &'static Algorithm

The key’s AEAD algorithm.

Source

pub fn tls_protocol_id(&self) -> TlsProtocolId

The key’s associated TlsProtocolId.

Trait Implementations§

Source§

impl Debug for TlsRecordOpeningKey

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, 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.