#[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
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
impl TlsCipherSuite
Sourcepub fn from_iana_name(name: &str) -> Option<Self>
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
impl Clone for TlsCipherSuite
Source§fn clone(&self) -> TlsCipherSuite
fn clone(&self) -> TlsCipherSuite
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TlsCipherSuite
Source§impl Debug for TlsCipherSuite
impl Debug for TlsCipherSuite
impl Eq for TlsCipherSuite
Source§impl Hash for TlsCipherSuite
impl Hash for TlsCipherSuite
Source§impl PartialEq for TlsCipherSuite
impl PartialEq for TlsCipherSuite
Source§fn eq(&self, other: &TlsCipherSuite) -> bool
fn eq(&self, other: &TlsCipherSuite) -> bool
self and other values to be equal, and is used by ==.