p2panda-encryption 0.5.2

Decentralised data- and message encryption for groups with post-compromise security and optional forward secrecy
Documentation
// SPDX-License-Identifier: MIT OR Apache-2.0

use crate::crypto::x25519::PublicKey;
use crate::key_bundle::{KeyBundleError, Lifetime, OneTimePreKeyId};

/// Key bundle holding data to establish a X3DH key-agreement.
pub trait KeyBundle {
    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>;
}