pub enum SupportedCipherSuite {
Tls12(&'static Tls12CipherSuite),
Tls13(&'static Tls13CipherSuite),
}
Expand description
A cipher suite supported by rustls.
This type carries both configuration and implementation. Compare with
CipherSuite
, which carries solely a cipher suite identifier.
Variants§
Tls12(&'static Tls12CipherSuite)
A TLS 1.2 cipher suite
Tls13(&'static Tls13CipherSuite)
A TLS 1.3 cipher suite
Implementations§
Source§impl SupportedCipherSuite
impl SupportedCipherSuite
Sourcepub fn suite(&self) -> CipherSuite
pub fn suite(&self) -> CipherSuite
The cipher suite’s identifier
Sourcepub(crate) fn hash_provider(&self) -> &'static dyn Hash
pub(crate) fn hash_provider(&self) -> &'static dyn Hash
The hash function the ciphersuite uses.
pub(crate) fn common(&self) -> &CipherSuiteCommon
Sourcepub fn tls13(&self) -> Option<&'static Tls13CipherSuite>
pub fn tls13(&self) -> Option<&'static Tls13CipherSuite>
Return the inner Tls13CipherSuite
for this suite, if it is a TLS1.3 suite.
Sourcepub fn version(&self) -> &'static SupportedProtocolVersion
pub fn version(&self) -> &'static SupportedProtocolVersion
Return supported protocol version for the cipher suite.
Sourcepub fn usable_for_signature_algorithm(
&self,
_sig_alg: SignatureAlgorithm,
) -> bool
pub fn usable_for_signature_algorithm( &self, _sig_alg: SignatureAlgorithm, ) -> bool
Return true if this suite is usable for a key only offering sig_alg
signatures. This resolves to true for all TLS1.3 suites.
Sourcepub(crate) fn usable_for_protocol(&self, proto: Protocol) -> bool
pub(crate) fn usable_for_protocol(&self, proto: Protocol) -> bool
Return true if this suite is usable for the given Protocol
.
All cipher suites are usable for TCP-TLS. Only TLS1.3 suites
with Tls13CipherSuite::quic
provided are usable for QUIC.
Sourcepub(crate) fn key_exchange_algorithms(&self) -> &[KeyExchangeAlgorithm]
pub(crate) fn key_exchange_algorithms(&self) -> &[KeyExchangeAlgorithm]
Return the list of KeyExchangeAlgorithm
s supported by this cipher suite.
TLS 1.3 cipher suites support both ECDHE and DHE key exchange, but TLS 1.2 suites support one or the other.
Sourcepub(crate) fn usable_for_kx_algorithm(&self, _kxa: KeyExchangeAlgorithm) -> bool
pub(crate) fn usable_for_kx_algorithm(&self, _kxa: KeyExchangeAlgorithm) -> bool
Say if the given KeyExchangeAlgorithm
is supported by this cipher suite.
TLS 1.3 cipher suites support all key exchange types, but TLS 1.2 suites support only one.
Trait Implementations§
Source§impl Clone for SupportedCipherSuite
impl Clone for SupportedCipherSuite
Source§fn clone(&self) -> SupportedCipherSuite
fn clone(&self) -> SupportedCipherSuite
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more