pub struct PqxdhPrekeyBundle {
pub signed_prekey: PublicKey,
pub signed_prekey_signature: Signature,
pub signed_prekey_id: String,
pub one_time_prekeys: BTreeMap<String, PublicKey>,
pub pq_signed_prekey: Vec<u8>,
pub pq_signed_prekey_signature: Signature,
pub pq_signed_prekey_id: String,
pub pq_one_time_keys: BTreeMap<String, Vec<u8>>,
pub pq_one_time_signatures: BTreeMap<String, Signature>,
}Expand description
PQXDH prekey bundle containing both classical and post-quantum keys
This bundle contains all the cryptographic material needed for a client to initiate a PQXDH key agreement with the bundle owner.
§Security Properties
- Hybrid Security: Combines X25519 (classical) and ML-KEM (post-quantum)
- Forward Secrecy: One-time keys provide perfect forward secrecy
- Authentication: All keys are signed by the identity key
- Key Rotation: Signed prekeys are rotated periodically
Fields§
§signed_prekey: PublicKeyMedium-term X25519 public key for ECDH, rotated periodically
signed_prekey_signature: SignatureSignature over the signed prekey by the identity key
signed_prekey_id: StringUnique identifier for this signed prekey
one_time_prekeys: BTreeMap<String, PublicKey>One-time X25519 public keys (each used exactly once)
pq_signed_prekey: Vec<u8>Medium-term ML-KEM public key, rotated periodically
pq_signed_prekey_signature: SignatureSignature over the PQ signed prekey by the identity key
pq_signed_prekey_id: StringUnique identifier for this PQ signed prekey
pq_one_time_keys: BTreeMap<String, Vec<u8>>One-time ML-KEM public keys (each used exactly once)
pq_one_time_signatures: BTreeMap<String, Signature>Signatures over each one-time PQ key by the identity key
Implementations§
Source§impl PqxdhPrekeyBundle
impl PqxdhPrekeyBundle
Sourcepub fn verify_signatures(
&self,
identity_key: &VerifyingKey,
) -> Result<(), PqxdhError>
pub fn verify_signatures( &self, identity_key: &VerifyingKey, ) -> Result<(), PqxdhError>
Verify all signatures in the prekey bundle
This checks that all prekeys are properly signed by the given identity key.
§Verification Process
- Verifies
signed_prekey_signatureoversigned_prekeybytes - Verifies
pq_signed_prekey_signatureoverpq_signed_prekeybytes - Verifies each
pq_one_time_signaturesover their respectivepq_one_time_keys - Ensures all PQ one-time keys have corresponding signatures (no missing or extra signatures)
§Security Properties
- Authentication: Proves all keys were signed by the identity key holder
- Integrity: Detects any tampering with prekey data after signing
- Completeness: Ensures signature coverage matches key availability
§Returns
Ok(())if all signatures are valid and completeErr(PqxdhError::SignatureVerificationFailed)if any signature is invalid or missing
Sourcepub fn one_time_key_count(&self) -> usize
pub fn one_time_key_count(&self) -> usize
Get the number of available one-time keys
Sourcepub fn has_one_time_keys(&self) -> bool
pub fn has_one_time_keys(&self) -> bool
Check if the bundle has any one-time keys available
Trait Implementations§
Source§impl Clone for PqxdhPrekeyBundle
impl Clone for PqxdhPrekeyBundle
Source§fn clone(&self) -> PqxdhPrekeyBundle
fn clone(&self) -> PqxdhPrekeyBundle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more