Debian Codegraph @

third_party/rust/mls-rs-core/src/identity/signing_identity.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 use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize};
6
7 use crate::crypto::SignaturePublicKey;
8
9 use super::Credential;
10
11 #[derive(Debug, Clone, Eq, Hash, PartialEq, PartialOrd, Ord, MlsSize, MlsEncode, MlsDecode)]
12 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
13 // #[cfg_attr(
14 // all(feature = "ffi", not(test)),
15 // safer_ffi_gen::ffi_type(clone, opaque)
16 // )]
17 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
18 /// MLS group member identity represented as a combination of a
19 /// public [`SignaturePublicKey`] and [`Credential`].
20 pub struct SigningIdentity {
21 pub signature_key: SignaturePublicKey,
22 pub credential: Credential,
23 }
24
25 impl SigningIdentity {
26 /// Create a new signing identity from `credential` and `signature_key`
27 pub fn new(credential: Credential, signature_key: SignaturePublicKey) -> SigningIdentity {
28 SigningIdentity {
29 credential,
30 signature_key,
31 }
32 }
33 }