pub struct OneTimeKeyBundle { /* private fields */ }Expand description
Key-bundle with public keys to be used exactly once.
Note that while pre-keys are signed for X3DH, bundles should be part of an authenticated messaging format where the whole payload (and thus it’s lifetime and one-time pre-key) is signed by the same identity to prevent replay and impersonation attacks.
Implementations§
Source§impl OneTimeKeyBundle
impl OneTimeKeyBundle
pub fn new( identity_key: PublicKey, signed_prekey: PreKey, prekey_signature: XSignature, onetime_prekey: Option<OneTimePreKey>, ) -> Self
Trait Implementations§
Source§impl Clone for OneTimeKeyBundle
impl Clone for OneTimeKeyBundle
Source§fn clone(&self) -> OneTimeKeyBundle
fn clone(&self) -> OneTimeKeyBundle
Returns a duplicate of the value. Read more
1.0.0 · 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 OneTimeKeyBundle
impl Debug for OneTimeKeyBundle
Source§impl<'de> Deserialize<'de> for OneTimeKeyBundle
impl<'de> Deserialize<'de> for OneTimeKeyBundle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl KeyBundle for OneTimeKeyBundle
impl KeyBundle for OneTimeKeyBundle
fn identity_key(&self) -> &PublicKey
fn signed_prekey(&self) -> &PublicKey
fn onetime_prekey(&self) -> Option<&PublicKey>
fn onetime_prekey_id(&self) -> Option<OneTimePreKeyId>
fn lifetime(&self) -> &Lifetime
fn verify(&self) -> Result<(), KeyBundleError>
Source§impl PartialEq for OneTimeKeyBundle
impl PartialEq for OneTimeKeyBundle
Source§impl<ID> PreKeyRegistry<ID, OneTimeKeyBundle> for KeyRegistry<ID>
impl<ID> PreKeyRegistry<ID, OneTimeKeyBundle> for KeyRegistry<ID>
type State = KeyRegistryState<ID>
type Error = Infallible
fn key_bundle( y: Self::State, id: &ID, ) -> Result<(Self::State, Option<OneTimeKeyBundle>), Self::Error>
Source§impl Serialize for OneTimeKeyBundle
impl Serialize for OneTimeKeyBundle
impl Eq for OneTimeKeyBundle
impl StructuralPartialEq for OneTimeKeyBundle
Auto Trait Implementations§
impl Freeze for OneTimeKeyBundle
impl RefUnwindSafe for OneTimeKeyBundle
impl Send for OneTimeKeyBundle
impl Sync for OneTimeKeyBundle
impl Unpin for OneTimeKeyBundle
impl UnwindSafe for OneTimeKeyBundle
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