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§
sourcefn encrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageEncrypter>
fn encrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageEncrypter>
Build a MessageEncrypter
for the given key/iv.
sourcefn decrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageDecrypter>
fn decrypter(&self, key: AeadKey, iv: Iv) -> Box<dyn MessageDecrypter>
Build a MessageDecrypter
for the given key/iv.
sourcefn extract_keys(
&self,
key: AeadKey,
iv: Iv,
) -> Result<ConnectionTrafficSecrets, UnsupportedOperationError>
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
.