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
impl TlsRecordOpeningKey
Sourcepub fn new(
algorithm: &'static Algorithm,
protocol: TlsProtocolId,
key_bytes: &[u8],
) -> Result<Self, Unspecified>
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 ofkey_bytes
does not match the chosen algorithm, or if an unsupported algorithm is provided.
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>
See super::OpeningKey::open_in_place()
for details.
§Errors
error::Unspecified
when ciphertext is invalid.
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>
See super::OpeningKey::open_within()
for details.
§Errors
error::Unspecified
when ciphertext is invalid.
Sourcepub fn tls_protocol_id(&self) -> TlsProtocolId
pub fn tls_protocol_id(&self) -> TlsProtocolId
The key’s associated TlsProtocolId
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlsRecordOpeningKey
impl RefUnwindSafe for TlsRecordOpeningKey
impl Send for TlsRecordOpeningKey
impl Sync for TlsRecordOpeningKey
impl Unpin for TlsRecordOpeningKey
impl UnwindSafe for TlsRecordOpeningKey
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
Mutably borrows from an owned value. Read more