Skip to main content

accept_encrypted_link

Function accept_encrypted_link 

Source
pub fn accept_encrypted_link(
    session: PubkySession,
    receiver_secret_key: [u8; 32],
    sender_identity_public_key: &PublicKey,
    sender_noise_public_key: &PublicKey,
    recovery_context: EncryptedLinkRecoveryContext,
    outbox_client: Pubky,
) -> Result<EncryptedLinkHandshake>
Expand description

Accepts a Noise XX Encrypted Link Handshake from a counterparty (responder role).

receiver_secret_key is the local Noise secret, not the Pubky identity secret. sender_identity_public_key selects the counterparty’s homeserver, while sender_noise_public_key is its authorized Ed25519 routing key. Authenticate EncryptedLink::remote_static_public_key against the signed X25519 key before using the completed link; routing keys alone do not authenticate it. recovery_context must mirror the initiator’s current recovery attempt IDs. Session creation, capability scope, and key rotation remain the caller’s responsibility.

Call advance_handshake until it returns HandshakeProgress::Complete.