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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S> CertifiedConn for TlsStream<S>

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,

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§