pub struct KeyPackage {
pub suite: u8,
pub community_id: CommunityId,
pub channel_id: ChannelId,
pub member_id: MemberId,
pub voice_session: VoiceSessionId,
pub kem_public: VoicePublicKey,
pub created_at: u64,
}Expand description
A participant’s voice key for one session in one voice channel.
Fields§
§suite: u82: the voice suite.
community_id: CommunityId3: the community.
channel_id: ChannelId4: the voice channel.
member_id: MemberId5: the participant; its member key signs.
voice_session: VoiceSessionId6: this participation.
kem_public: VoicePublicKey7: the X-Wing public key sender keys are wrapped to.
created_at: u648: ms since the epoch.
Implementations§
Source§impl KeyPackage
impl KeyPackage
Sourcepub 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>
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>
Sourcepub fn verify(
wire: &[u8],
member_key: &PublicKey,
expected: &PackageExpectation,
) -> Result<SignedKeyPackage, VoiceError>
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
VoiceError::Length, VoiceError::Signed (checked before decoding) or
VoiceError::Mismatch.
Trait Implementations§
Source§impl Clone for KeyPackage
impl Clone for KeyPackage
Source§fn clone(&self) -> KeyPackage
fn clone(&self) -> KeyPackage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyPackage
impl Debug for KeyPackage
Source§impl Decode for KeyPackage
impl Decode for KeyPackage
Source§impl Encode for KeyPackage
impl Encode for KeyPackage
impl Eq for KeyPackage
Source§impl PartialEq for KeyPackage
impl PartialEq for KeyPackage
Source§impl SignedObject for KeyPackage
impl SignedObject for KeyPackage
Source§const CONTEXT: Context = Context::VoiceKeyPackage
const CONTEXT: Context = Context::VoiceKeyPackage
The context the verifier supplies for this type (§3.5).
Source§fn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError>
fn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError>
Decodes canonical bytes without verifying them. Receivers use
Signed::verify_and_decode. Read moreSource§fn sign(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
fn sign(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
Encodes and signs (hedged). Read more
Source§fn sign_deterministic(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
fn sign_deterministic(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
Encodes and signs deterministically. Golden test vectors only. Read more
impl StructuralPartialEq for KeyPackage
Auto Trait Implementations§
impl Freeze for KeyPackage
impl RefUnwindSafe for KeyPackage
impl Send for KeyPackage
impl Sync for KeyPackage
impl Unpin for KeyPackage
impl UnsafeUnpin for KeyPackage
impl UnwindSafe for KeyPackage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more