pub struct Session {
pub version: TlsVersion,
pub cipher_suite: CipherSuite,
pub group: Option<NamedGroup>,
pub signature_scheme: Option<SignatureScheme>,
pub mutual_auth: bool,
pub peer_key: Option<PublicKey>,
pub peer_cert_validity_days: Option<u32>,
pub encrypt_then_mac: Option<bool>,
}Expand description
What was negotiated, as the TLS library reports it after the handshake.
Start from Session::new and set what your library reports:
let s = Session {
group: Some(NamedGroup::BRAINPOOLP256R1),
mutual_auth: true,
peer_key: Some(PublicKey::Ec(Curve::BrainpoolP256r1)),
..Session::new(TlsVersion::TLS12, CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)
};Fields§
§version: TlsVersionThe protocol version.
cipher_suite: CipherSuiteThe cipher suite.
group: Option<NamedGroup>The key-exchange group. If the profile restricts groups and this is None, the
check reports Violation::GroupUnknown.
signature_scheme: Option<SignatureScheme>The peer’s handshake signature scheme. Checked when reported.
mutual_auth: boolWhether both sides authenticated with a certificate.
peer_key: Option<PublicKey>The peer certificate’s public key. If the profile restricts keys and this is
None, the check reports Violation::PeerKeyUnknown.
peer_cert_validity_days: Option<u32>The peer certificate’s validity period (notAfter − notBefore) in days.
encrypt_then_mac: Option<bool>Whether Encrypt-then-MAC (RFC 7366) is in use. Only matters for CBC suites.
Implementations§
Source§impl Session
impl Session
Sourcepub const fn new(version: TlsVersion, cipher_suite: CipherSuite) -> Self
pub const fn new(version: TlsVersion, cipher_suite: CipherSuite) -> Self
A session with this version and suite, and nothing else known.
Trait Implementations§
impl Copy for Session
impl Eq for Session
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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