Struct aws_lc_rs::aead::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>,

§

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

§

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.