pub struct NamedGroup(pub u16);Expand description
The NamedGroup TLS protocol enum. Values in this enum are taken
from the various RFCs covering TLS, and are listed by IANA.
This enum is used for recognizing key exchange groups advertised
by a peer during a TLS handshake. It is not a list of groups that
Rustls supports. The supported groups are determined via the
CryptoProvider interface.
Protocol enumerations in rustls are represented with a struct, which contains the numeric value used on the wire (in this case, u16). Each known value has a named const item on this type – this can be used in a match arm or to access the numeric value.
If a known value does not exist for a value you need, you can simply create it locally:
pub const MyValue: NamedGroup = NamedGroup(123);The Debug impl for this type also looks up and pretty-prints
known named items. Unknown values are formatted in hexadecimal.
Tuple Fields§
§0: u16Implementations§
Source§impl NamedGroup
impl NamedGroup
pub const secp256r1: Self
pub const secp384r1: Self
pub const secp521r1: Self
pub const X25519: Self
pub const X448: Self
Sourcepub const brainpoolP256r1tls13: Self
pub const brainpoolP256r1tls13: Self
Sourcepub const brainpoolP384r1tls13: Self
pub const brainpoolP384r1tls13: Self
Sourcepub const brainpoolP512r1tls13: Self
pub const brainpoolP512r1tls13: Self
pub const FFDHE2048: Self
pub const FFDHE3072: Self
pub const FFDHE4096: Self
pub const FFDHE6144: Self
pub const FFDHE8192: Self
Sourcepub const secp384r1MLKEM1024: Self
pub const secp384r1MLKEM1024: Self
Source§impl NamedGroup
impl NamedGroup
Sourcepub fn key_exchange_algorithm(self) -> KeyExchangeAlgorithm
pub fn key_exchange_algorithm(self) -> KeyExchangeAlgorithm
Return the key exchange algorithm associated with this NamedGroup
Sourcepub fn usable_for_version(&self, version: ProtocolVersion) -> bool
pub fn usable_for_version(&self, version: ProtocolVersion) -> bool
Returns whether this NamedGroup is usable for the given protocol version.
Trait Implementations§
Source§impl Clone for NamedGroup
impl Clone for NamedGroup
Source§fn clone(&self) -> NamedGroup
fn clone(&self) -> NamedGroup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more