pub fn tls_server_end_point(&self) -> crate::Result<Option<Vec<u8>>> {
        let cert = if self.0.ssl().is_server() {
            self.0.ssl().certificate().map(|x| x.to_owned())
        } else {
            self.0.ssl().peer_certificate()
        };

        let cert = match cert {
            Some(cert) => cert,
            None => return Ok(None),
        };

        let algo_nid = cert.signature_algorithm().object().nid();
        let signature_algorithms = match algo_nid.signature_algorithms() {
            Some(algs) => algs,
            None => return Ok(None),
        };

        let md = match signature_algorithms.digest {
            Nid::MD5 | Nid::SHA1 => MessageDigest::sha256(),
            nid => match MessageDigest::from_nid(nid) {
                Some(md) => md,
                None => return Ok(None),
            },
        };

        let digest = cert.digest(md)?;

        Ok(Some(digest.to_vec()))
    }
/// Returns the tls-server-end-point channel binding data as defined in [RFC 5929].
///
/// [RFC 5929]: https://tools.ietf.org/html/rfc5929
Returns the tls-server-end-point channel binding data as defined in [RFC 5929].
Returns the tls - server - end - point channel binding data as defined in [ RFC 5929 ] .
pub fn tls_server_end_point(&self) -> crate::Result<Option<Vec<u8>>> {
        let cert = if self.0.ssl().is_server() {
            self.0.ssl().certificate().map(|x| x.to_owned())
        } else {
            self.0.ssl().peer_certificate()
        };
        let cert = match cert {
            Some(cert) => cert,
            None => return Ok(None),
        };
        let algo_nid = cert.signature_algorithm().object().nid();
        let signature_algorithms = match algo_nid.signature_algorithms() {
            Some(algs) => algs,
            None => return Ok(None),
        };
        let md = match signature_algorithms.digest {
            Nid::MD5 | Nid::SHA1 => MessageDigest::sha256(),
            nid => match MessageDigest::from_nid(nid) {
                Some(md) => md,
                None => return Ok(None),
            },
        };
        let digest = cert.digest(md)?;
        Ok(Some(digest.to_vec()))
    }
pub fn tls_server_end_point ( & self ) -> crate :: Result < Option < Vec < u8 > > > { let cert = if self . 0 . ssl ( ) . is_server ( ) { self . 0 . ssl ( ) . certificate ( ) . map ( | x | x . to_owned ( ) ) } else { self . 0 . ssl ( ) . peer_certificate ( ) } ; let cert = match cert { Some ( cert ) => cert , None => return Ok ( None ) , } ; let algo_nid = cert . signature_algorithm ( ) . object ( ) . nid ( ) ; let signature_algorithms = match algo_nid . signature_algorithms ( ) { Some ( algs ) => algs , None => return Ok ( None ) , } ; let md = match signature_algorithms . digest { Nid :: MD5 | Nid :: SHA1 => MessageDigest :: sha256 ( ) , nid => match MessageDigest :: from_nid ( nid ) { Some ( md ) => md , None => return Ok ( None ) , } , } ; let digest = cert . digest ( md ) ? ; Ok ( Some ( digest . to_vec ( ) ) ) }
Returns the tls-server-end-point channel binding data as defined in [RFC 5929].
Returns the tls - server - end - point channel binding data as defined in [ RFC 5929 ] .
&self
&self