pub trait CryptoProvider {
type CipherSuite: TlsCipherSuite;
type Signature: AsRef<[u8]>;
// Required method
fn rng(&mut self) -> impl CryptoRngCore;
// Provided methods
fn verifier(
&mut self,
) -> Result<&mut impl TlsVerifier<Self::CipherSuite>, TlsError> { ... }
fn signer(
&mut self,
) -> Result<(impl SignerMut<Self::Signature>, SignatureScheme), TlsError> { ... }
fn client_cert(&mut self) -> Option<Certificate<impl AsRef<[u8]>>> { ... }
}Required Associated Types§
type CipherSuite: TlsCipherSuite
type Signature: AsRef<[u8]>
Required Methods§
fn rng(&mut self) -> impl CryptoRngCore
Provided Methods§
fn verifier( &mut self, ) -> Result<&mut impl TlsVerifier<Self::CipherSuite>, TlsError>
Sourcefn signer(
&mut self,
) -> Result<(impl SignerMut<Self::Signature>, SignatureScheme), TlsError>
fn signer( &mut self, ) -> Result<(impl SignerMut<Self::Signature>, SignatureScheme), TlsError>
Provide a signing key for client certificate authentication.
The provider resolves the private key internally (e.g. from memory, flash, or a hardware crypto module such as an HSM/TPM/secure element).
Sourcefn client_cert(&mut self) -> Option<Certificate<impl AsRef<[u8]>>>
fn client_cert(&mut self) -> Option<Certificate<impl AsRef<[u8]>>>
Resolve the client certificate for mutual TLS authentication.
Return None if no client certificate is available (an empty certificate message will
be sent to the server). The data type D can be borrowed (&[u8]) or owned
(e.g. heapless::Vec<u8, N>) — the certificate is only needed long enough to encode
into the TLS message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".