pub struct EncryptedLinkSnapshot { /* private fields */ }Expand description
Serializable snapshot of an established EncryptedLink.
Serialize with serialize and restore with
restore_encrypted_link. Snapshot bytes
include sensitive key material and must be stored as secrets.
Implementations§
Source§impl EncryptedLinkSnapshot
impl EncryptedLinkSnapshot
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize to a compact binary format for durable storage.
The output contains the pubky-noise session state followed by the
counterparty’s 32-byte Noise public key and 72-byte recovery context.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self>
pub fn deserialize(bytes: &[u8]) -> Result<Self>
Deserialize from bytes previously produced by serialize.
Returns PaykitError::InvalidData if the bytes are malformed or the
embedded public key cannot be reconstructed.
Sourcepub fn recipient(&self) -> &PublicKey
pub fn recipient(&self) -> &PublicKey
Access the counterparty’s public key embedded in the snapshot.
Sourcepub fn remote_noise_public_key(&self) -> &PublicKey
pub fn remote_noise_public_key(&self) -> &PublicKey
Access the counterparty’s identity-wide Noise public key.
Sourcepub fn recovery_context(&self) -> &EncryptedLinkRecoveryContext
pub fn recovery_context(&self) -> &EncryptedLinkRecoveryContext
Recovery attempts used to derive this connection’s stream paths.
Sourcepub fn link_id(&self) -> Option<[u8; 32]>
pub fn link_id(&self) -> Option<[u8; 32]>
Stable identifier of the completed Noise handshake, unchanged by transport messages.
Sourcepub async fn has_pending_private_application_message(
&self,
public_storage: &PublicStorage,
local_identity_public_key: &PublicKey,
local_noise_secret_key: &[u8; 32],
) -> Result<bool>
pub async fn has_pending_private_application_message( &self, public_storage: &PublicStorage, local_identity_public_key: &PublicKey, local_noise_secret_key: &[u8; 32], ) -> Result<bool>
Check whether the next private message slot exists without restoring Noise.
This is an advisory HEAD request. It does not authenticate a message or advance the snapshot. Before receiving, reload the authoritative state and use the ordinary locked receive workflow. Session authorization and key rotation remain the caller’s responsibility.