Trait tls_api::TlsAcceptorType
source · [−]pub trait TlsAcceptorType: Debug + Display + Sync + 'static {
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
fn 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.
fn supports_alpn(&self) -> bool
fn supports_alpn(&self) -> bool
Whether this implementation supports ALPN negotiation.
fn 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.
fn supports_pkcs12_keys(&self) -> bool
fn supports_pkcs12_keys(&self) -> bool
Whether this implementation supports construction of acceptor using PKCS #12 file.
fn 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
.
fn 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
.