Struct crypto::voice::KeyPackage
zaun_community_protocol::crypto::voice::KeyPackage · Struct
pub struct KeyPackage { … }A participant’s voice key for one session in one voice channel.
Fields
Section titled “Fields”suite: u8
Section titled “suite: u8”2: the voice suite.
community_id: CommunityId
Section titled “community_id: CommunityId”3: the community.
channel_id: ChannelId
Section titled “channel_id: ChannelId”4: the voice channel.
member_id: MemberId
Section titled “member_id: MemberId”5: the participant; its member key signs.
voice_session: VoiceSessionId
Section titled “voice_session: VoiceSessionId”6: this participation.
kem_public: VoicePublicKey
Section titled “kem_public: VoicePublicKey”7: the X-Wing public key sender keys are wrapped to.
created_at: u64
Section titled “created_at: u64”8: ms since the epoch.
Methods
Section titled “Methods”create
Section titled “create”pub fn create(member_key: &SecretKey, identity: &VoiceIdentity, community_id: CommunityId, channel_id: ChannelId, member_id: MemberId, voice_session: VoiceSessionId, created_at: u64) -> Result<SignedKeyPackage, VoiceError>Makes and signs this participant’s key package.
Errors
Section titled “Errors”VoiceError::Signed when signing fails.
verify
Section titled “verify”pub fn verify(wire: &[u8], member_key: &PublicKey, expected: &PackageExpectation) -> Result<SignedKeyPackage, VoiceError>Verifies a peer’s key package from the wire under member_key (the roster’s key for
expected.member_id), then checks the community, channel and member.
Errors
Section titled “Errors”VoiceError::Length, VoiceError::Signed (checked before decoding) or
VoiceError::Mismatch.
Trait implementations
Section titled “Trait implementations”Clone, Debug, Decode, Encode, Eq, PartialEq, SignedObject, StructuralPartialEq