Trait TlsAcceptorType

Source
pub trait TlsAcceptorType:
    Debug
    + Display
    + Sync
    + 'static {
    // Required methods
    fn implemented(&self) -> bool;
    fn supports_alpn(&self) -> bool;
    fn supports_der_keys(&self) -> bool;
    fn supports_pkcs12_keys(&self) -> bool;
    fn info(&self) -> ImplInfo;
    fn builder_from_der_key(
        &self,
        cert: &[u8],
        key: &[u8],
    ) -> Result<TlsAcceptorBuilderBox>;
    fn builder_from_pkcs12(
        &self,
        pkcs12: &[u8],
        passphrase: &str,
    ) -> Result<TlsAcceptorBuilderBox>;
}
Expand description

Similar to TlsAcceptor, but it is dynamic, does not require type parameter.

This can be obtained with TlsAcceptor::TYPE_DYN.

Required Methods§

Source

fn implemented(&self) -> bool

Whether this acceptor type is implemented.

For example, tls-api-security-framework is available on Linux, but all operations result in error, so implemented() returns false for that implementation.

Source

fn supports_alpn(&self) -> bool

Whether this implementation supports ALPN negotiation.

Source

fn supports_der_keys(&self) -> bool

Whether this implementation supports construction of acceptor using a pair of a DER certificate and file pair.

Source

fn supports_pkcs12_keys(&self) -> bool

Whether this implementation supports construction of acceptor using PKCS #12 file.

Source

fn info(&self) -> ImplInfo

Unspecified version information about this implementation.

Source

fn builder_from_der_key( &self, cert: &[u8], key: &[u8], ) -> Result<TlsAcceptorBuilderBox>

New builder from given server key.

This operation is guaranteed to fail if not TlsAcceptorType::supports_der_keys.

Source

fn builder_from_pkcs12( &self, pkcs12: &[u8], passphrase: &str, ) -> Result<TlsAcceptorBuilderBox>

New builder from given server key.

This operation is guaranteed to fail if not TlsAcceptorType::supports_pkcs12_keys.

Implementors§