Trait libsignal_protocol::GenericSignedPreKey

source ·
pub trait GenericSignedPreKey {
    type KeyPair: KeyPairSerde;
    type Id: From<u32> + Into<u32>;

    // Required methods
    fn get_storage(&self) -> &SignedPreKeyRecordStructure;
    fn from_storage(storage: SignedPreKeyRecordStructure) -> Self;

    // Provided methods
    fn new(
        id: Self::Id,
        timestamp: Timestamp,
        key_pair: &Self::KeyPair,
        signature: &[u8],
    ) -> Self
       where Self: Sized { ... }
    fn serialize(&self) -> Result<Vec<u8>> { ... }
    fn deserialize(data: &[u8]) -> Result<Self>
       where Self: Sized { ... }
    fn id(&self) -> Result<Self::Id> { ... }
    fn timestamp(&self) -> Result<Timestamp> { ... }
    fn signature(&self) -> Result<Vec<u8>> { ... }
    fn public_key(&self) -> Result<<Self::KeyPair as KeyPairSerde>::PublicKey> { ... }
    fn key_pair(&self) -> Result<Self::KeyPair> { ... }
}

Required Associated Types§

source

type KeyPair: KeyPairSerde

source

type Id: From<u32> + Into<u32>

Required Methods§

source

fn get_storage(&self) -> &SignedPreKeyRecordStructure

source

fn from_storage(storage: SignedPreKeyRecordStructure) -> Self

Provided Methods§

source

fn new( id: Self::Id, timestamp: Timestamp, key_pair: &Self::KeyPair, signature: &[u8], ) -> Self
where Self: Sized,

source

fn serialize(&self) -> Result<Vec<u8>>

source

fn deserialize(data: &[u8]) -> Result<Self>
where Self: Sized,

source

fn id(&self) -> Result<Self::Id>

source

fn timestamp(&self) -> Result<Timestamp>

source

fn signature(&self) -> Result<Vec<u8>>

source

fn public_key(&self) -> Result<<Self::KeyPair as KeyPairSerde>::PublicKey>

source

fn key_pair(&self) -> Result<Self::KeyPair>

Object Safety§

This trait is not object safe.

Implementors§