Trait x3dh_ke::Key[][src]

pub trait Key {
    fn default() -> Self;
fn ex_private_key(&self) -> Option<SecretKey>;
fn ex_public_key(&self) -> PublicKey;
fn strip(&self) -> Self;
fn to_bytes(&self) -> Vec<u8>;
fn from_bytes(data: &[u8]) -> Result<Self, &'static str>
    where
        Self: Sized
; fn diffie_hellman<T: Key>(&self, other: &T) -> SharedSecret { ... }
fn sign(&self, data: &[u8]) -> Signature { ... }
fn verify(&self, message: &[u8], signature: &Signature) -> bool { ... } }

Required methods

fn default() -> Self[src]

fn ex_private_key(&self) -> Option<SecretKey>[src]

fn ex_public_key(&self) -> PublicKey[src]

fn strip(&self) -> Self[src]

fn to_bytes(&self) -> Vec<u8>[src]

fn from_bytes(data: &[u8]) -> Result<Self, &'static str> where
    Self: Sized
[src]

Provided methods

fn diffie_hellman<T: Key>(&self, other: &T) -> SharedSecret[src]

fn sign(&self, data: &[u8]) -> Signature[src]

fn verify(&self, message: &[u8], signature: &Signature) -> bool[src]

Implementors

impl Key for EphemeralKey[src]

fn default() -> Self[src]

fn ex_private_key(&self) -> Option<SecretKey>[src]

fn ex_public_key(&self) -> PublicKey[src]

fn strip(&self) -> Self[src]

fn to_bytes(&self) -> Vec<u8>[src]

fn from_bytes(data: &[u8]) -> Result<Self, &'static str> where
    Self: Sized
[src]

impl Key for IdentityKey[src]

fn default() -> Self[src]

fn ex_private_key(&self) -> Option<SecretKey>[src]

fn ex_public_key(&self) -> PublicKey[src]

fn strip(&self) -> Self[src]

fn to_bytes(&self) -> Vec<u8>[src]

fn from_bytes(data: &[u8]) -> Result<Self, &'static str> where
    Self: Sized
[src]

impl Key for OneTimePreKey[src]

fn default() -> Self[src]

fn ex_private_key(&self) -> Option<SecretKey>[src]

fn ex_public_key(&self) -> PublicKey[src]

fn strip(&self) -> Self[src]

fn to_bytes(&self) -> Vec<u8>[src]

fn from_bytes(data: &[u8]) -> Result<Self, &'static str> where
    Self: Sized
[src]

impl Key for SignedPreKey[src]

fn default() -> Self[src]

fn ex_private_key(&self) -> Option<SecretKey>[src]

fn ex_public_key(&self) -> PublicKey[src]

fn strip(&self) -> Self[src]

fn to_bytes(&self) -> Vec<u8>[src]

fn from_bytes(data: &[u8]) -> Result<Self, &'static str> where
    Self: Sized
[src]