pub struct TlsCryptoInfo<D> { /* private fields */ }Expand description
A wrapper around the libc::tls12_crypto_info_* structs, use with setting
up the kTLS r/w parameters on the TCP socket.
This is originated from the nix crate, which currently does not support
AES-128-CCM, SM4-* or ARIA-*, so we implement our own version here.
This is a low-level structure, usually you don’t need to use it directly unless you are implementing a higher-level abstraction.
Implementations§
Source§impl<D> TlsCryptoInfo<D>
impl<D> TlsCryptoInfo<D>
Sourcepub fn new(
protocol_version: ProtocolVersion,
secrets: ConnectionTrafficSecrets,
seq: u64,
) -> Result<Self>
pub fn new( protocol_version: ProtocolVersion, secrets: ConnectionTrafficSecrets, seq: u64, ) -> Result<Self>
Creates a new TlsCryptoInfo from the given protocol version and
connection traffic secrets.
§Errors
Invalid protocol version (only TLS 1.2 and TLS 1.3 are supported).
Source§impl TlsCryptoInfo<Tx>
impl TlsCryptoInfo<Tx>
Sourcepub fn set<S: AsFd>(&self, socket: &S) -> Result<()>
pub fn set<S: AsFd>(&self, socket: &S) -> Result<()>
Sets the kTLS parameters on the given file descriptor for the transmit direction.
This is a low-level function, usually you don’t need to call it directly unless you are implementing a higher-level abstraction.
§Errors
Errors may include invalid crypto materials or syscall errors.