Trait rustls::crypto::cipher::Tls13AeadAlgorithm

source ·
pub trait Tls13AeadAlgorithm: Send + Sync {
    // Required methods
    fn encrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageEncrypter>;
    fn decrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageDecrypter>;
    fn key_len(&self) -> usize;
    fn extract_keys(
        &self,
        key: AeadKey,
        iv: Iv,
    ) -> Result<ConnectionTrafficSecrets, UnsupportedOperationError>;

    // Provided method
    fn fips(&self) -> bool { ... }
}
Expand description

Factory trait for building MessageEncrypter and MessageDecrypter for a TLS1.3 cipher suite.

Required Methods§

source

fn encrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageEncrypter>

Build a MessageEncrypter for the given key/iv.

source

fn decrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageDecrypter>

Build a MessageDecrypter for the given key/iv.

source

fn key_len(&self) -> usize

The length of key in bytes required by encrypter() and decrypter().

source

fn extract_keys( &self, key: AeadKey, iv: Iv, ) -> Result<ConnectionTrafficSecrets, UnsupportedOperationError>

Convert the key material from key/iv, into a ConnectionTrafficSecrets item.

May return UnsupportedOperationError if the AEAD algorithm is not a supported variant of ConnectionTrafficSecrets.

Provided Methods§

source

fn fips(&self) -> bool

Return true if this is backed by a FIPS-approved implementation.

Implementors§