Skip to main content

TlsCipherSuite

Enum TlsCipherSuite 

Source
#[non_exhaustive]
pub enum TlsCipherSuite { Aes128GcmSha256, Aes256GcmSha384, Chacha20Poly1305Sha256, Aes128CcmSha256, Aes128Ccm8Sha256, Sha256Prf, Sha384Prf, Sha512Prf, }
Expand description

TLS cipher suite identifier for MAC negotiation.

Covers all TLS 1.3 cipher suites (RFC 8446 §B.4) and common TLS 1.2 HMAC-based cipher suites.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Aes128GcmSha256

TLS_AES_128_GCM_SHA256 (0x1301) — HMAC-SHA-256 for handshake MACs.

§

Aes256GcmSha384

TLS_AES_256_GCM_SHA384 (0x1302) — HMAC-SHA-384 for handshake MACs.

§

Chacha20Poly1305Sha256

TLS_CHACHA20_POLY1305_SHA256 (0x1303) — HMAC-SHA-256 for handshake MACs.

§

Aes128CcmSha256

TLS_AES_128_CCM_SHA256 (0x1304) — HMAC-SHA-256 for handshake MACs.

§

Aes128Ccm8Sha256

TLS_AES_128_CCM_8_SHA256 (0x1305) — HMAC-SHA-256 for handshake MACs.

§

Sha256Prf

Any TLS 1.2 suite with SHA-256 PRF (e.g. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256).

§

Sha384Prf

Any TLS 1.2 suite with SHA-384 PRF (e.g. TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384).

§

Sha512Prf

Any TLS 1.2 suite with SHA-512 PRF.

Implementations§

Source§

impl TlsCipherSuite

Source

pub fn from_iana_name(name: &str) -> Option<Self>

Parse a TLS cipher suite IANA name into a TlsCipherSuite.

Returns None if the string is not a recognized cipher suite name.

§Examples
use oxicrypto_mac::TlsCipherSuite;

assert_eq!(
    TlsCipherSuite::from_iana_name("TLS_AES_256_GCM_SHA384"),
    Some(TlsCipherSuite::Aes256GcmSha384),
);

Trait Implementations§

Source§

impl Clone for TlsCipherSuite

Source§

fn clone(&self) -> TlsCipherSuite

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TlsCipherSuite

Source§

impl Debug for TlsCipherSuite

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for TlsCipherSuite

Source§

impl Hash for TlsCipherSuite

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TlsCipherSuite

Source§

fn eq(&self, other: &TlsCipherSuite) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TlsCipherSuite

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> MaybeDebug for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.