pub struct SenderKeys {
pub suite: u8,
pub community_id: CommunityId,
pub channel_id: ChannelId,
pub sender_member: MemberId,
pub sender_session: VoiceSessionId,
pub epoch: u32,
pub kid: u64,
pub recipients: Vec<RecipientEntry>,
pub created_at: u64,
}Expand description
The signed statement of one sender’s epoch (see the module table).
Fields§
§suite: u82: the voice suite.
community_id: CommunityId3: the community.
channel_id: ChannelId4: the voice channel.
sender_member: MemberId5: the sender; its member key signs.
sender_session: VoiceSessionId6: the sender’s voice session.
epoch: u327: the epoch.
kid: u648: the SFrame KID of this epoch.
recipients: Vec<RecipientEntry>9: the recipients, at most MAX_RECIPIENTS, each once.
created_at: u6410: ms since the epoch.
Implementations§
Source§impl SenderKeys
impl SenderKeys
Sourcepub fn sign_epoch(
member_key: &SecretKey,
ctx: &WrapContext,
recipients: Vec<RecipientEntry>,
created_at: u64,
) -> Result<SignedSenderKeys, VoiceError>
pub fn sign_epoch( member_key: &SecretKey, ctx: &WrapContext, recipients: Vec<RecipientEntry>, created_at: u64, ) -> Result<SignedSenderKeys, VoiceError>
Signs a sender’s epoch over the wrapped keys it made.
§Errors
VoiceError::Recipients for too many or repeated recipients; VoiceError::Signed.
Sourcepub fn verify(
wire: &[u8],
sender_key: &PublicKey,
expected: &SenderKeysExpectation,
) -> Result<SignedSenderKeys, VoiceError>
pub fn verify( wire: &[u8], sender_key: &PublicKey, expected: &SenderKeysExpectation, ) -> Result<SignedSenderKeys, VoiceError>
Verifies a sender-keys message from the wire under the sender’s member key.
§Errors
VoiceError::Length, VoiceError::Decode, VoiceError::Signed (checked
before the body is decoded) or VoiceError::Mismatch.
Trait Implementations§
Source§impl Clone for SenderKeys
impl Clone for SenderKeys
Source§fn clone(&self) -> SenderKeys
fn clone(&self) -> SenderKeys
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 SenderKeys
impl Debug for SenderKeys
Source§impl Decode for SenderKeys
impl Decode for SenderKeys
Source§impl Encode for SenderKeys
impl Encode for SenderKeys
impl Eq for SenderKeys
Source§impl PartialEq for SenderKeys
impl PartialEq for SenderKeys
Source§impl SignedObject for SenderKeys
impl SignedObject for SenderKeys
Source§const CONTEXT: Context = Context::VoiceSenderKeys
const CONTEXT: Context = Context::VoiceSenderKeys
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 SenderKeys
Auto Trait Implementations§
impl Freeze for SenderKeys
impl RefUnwindSafe for SenderKeys
impl Send for SenderKeys
impl Sync for SenderKeys
impl Unpin for SenderKeys
impl UnsafeUnpin for SenderKeys
impl UnwindSafe for SenderKeys
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