Skip to main content

CertifiedConn

Trait CertifiedConn 

Source
pub trait CertifiedConn {
    // Required methods
    fn export_keying_material(
        &self,
        len: usize,
        label: &[u8],
        context: Option<&[u8]>,
    ) -> IoResult<Vec<u8>>;
    fn peer_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>;
    fn own_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>;
}
Expand description

An object with a peer certificate: typically a TLS connection.

Required Methods§

Source

fn export_keying_material( &self, len: usize, label: &[u8], context: Option<&[u8]>, ) -> IoResult<Vec<u8>>

Return the keying material (RFC 5705) given a label and an optional context.

Source

fn peer_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>

Try to return the (DER-encoded) peer certificate for this connection, if any.

Source

fn own_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>

Try to return the (DER-encoded) link certificate (if any) containing the key we used to authenticate this connection.

Ordinarily, this will return a certificate for server connections, and None for client connections.

Implementations on Foreign Types§

Source§

impl<S> CertifiedConn for TlsStream<S>

Available on (crate features native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature rustls only.
Source§

fn peer_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>

Source§

fn export_keying_material( &self, len: usize, label: &[u8], context: Option<&[u8]>, ) -> IoResult<Vec<u8>>

Source§

fn own_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>

Source§

impl<S> CertifiedConn for TlsStream<S>
where S: AsyncRead + AsyncWrite + Unpin,

Available on (crate features native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature native-tls only.
Source§

fn peer_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>

Source§

fn export_keying_material( &self, _len: usize, _label: &[u8], _context: Option<&[u8]>, ) -> IoResult<Vec<u8>>

Source§

fn own_certificate(&self) -> IoResult<Option<Cow<'_, [u8]>>>

Implementors§

Source§

impl CertifiedConn for UnimplementedTls

Available on (crate features native-tls or rustls) and (crate features async-std or tokio or smol) only.
Source§

impl<S: AsyncRead + AsyncWrite + Unpin> CertifiedConn for RustlsServerStream<S>

Available on (crate features native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature rustls and crate feature tls-server only.