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§
Sourcefn implemented(&self) -> bool
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.
Sourcefn supports_alpn(&self) -> bool
fn supports_alpn(&self) -> bool
Whether this implementation supports ALPN negotiation.
Sourcefn supports_der_keys(&self) -> bool
fn supports_der_keys(&self) -> bool
Whether this implementation supports construction of acceptor using a pair of a DER certificate and file pair.
Sourcefn supports_pkcs12_keys(&self) -> bool
fn supports_pkcs12_keys(&self) -> bool
Whether this implementation supports construction of acceptor using PKCS #12 file.
Sourcefn builder_from_der_key(
&self,
cert: &[u8],
key: &[u8],
) -> Result<TlsAcceptorBuilderBox>
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
.
Sourcefn builder_from_pkcs12(
&self,
pkcs12: &[u8],
passphrase: &str,
) -> Result<TlsAcceptorBuilderBox>
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
.