CryptoProvider

Trait CryptoProvider 

Source
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,
        _key_der: &[u8],
    ) -> Result<(impl SignerMut<Self::Signature>, SignatureScheme), TlsError> { ... }
}

Required Associated Types§

Required Methods§

Source

fn rng(&mut self) -> impl CryptoRngCore

Provided Methods§

Source

fn verifier( &mut self, ) -> Result<&mut impl TlsVerifier<Self::CipherSuite>, TlsError>

Source

fn signer( &mut self, _key_der: &[u8], ) -> Result<(impl SignerMut<Self::Signature>, SignatureScheme), TlsError>

Decode and validate a private signing key from key_der.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: CryptoProvider> CryptoProvider for &mut T

Source§

type CipherSuite = <T as CryptoProvider>::CipherSuite

Source§

type Signature = <T as CryptoProvider>::Signature

Source§

fn rng(&mut self) -> impl CryptoRngCore

Source§

fn verifier( &mut self, ) -> Result<&mut impl TlsVerifier<Self::CipherSuite>, TlsError>

Source§

fn signer( &mut self, key_der: &[u8], ) -> Result<(impl SignerMut<Self::Signature>, SignatureScheme), TlsError>

Implementors§

Source§

impl<CipherSuite: TlsCipherSuite, RNG: CryptoRngCore> CryptoProvider for UnsecureProvider<CipherSuite, RNG>