rustls::crypto::cipher

Trait 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§