Debian Codegraph @

third_party/rust/mls-rs/src/extension/recommended.rs

raw
1 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 // Copyright by contributors to this project.
3 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
4
5 //! Recommended MLS extensions.
6 //!
7 //! Optional, but recommended extensions from [The Messaging Layer
8 //! Security (MLS) Extensions][1].
9 //!
10 //! [1]: https://datatracker.ietf.org/doc/html/draft-ietf-mls-extensions-04
11
12 use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize};
13 use mls_rs_core::extension::{ExtensionType, MlsCodecExtension};
14
15 /// Last resort key packages.
16 ///
17 /// The extension allows clients that pre-publish key packages to
18 /// signal to the Delivery Service which key packages are meant to be
19 /// used as last resort key packages.
20 #[cfg(feature = "last_resort_key_package_ext")]
21 #[derive(Debug, Clone, PartialEq, Eq, MlsSize, MlsEncode, MlsDecode)]
22 pub struct LastResortKeyPackageExt;
23
24 #[cfg(feature = "last_resort_key_package_ext")]
25 impl MlsCodecExtension for LastResortKeyPackageExt {
26 fn extension_type() -> ExtensionType {
27 ExtensionType::LAST_RESORT_KEY_PACKAGE
28 }
29 }