pub struct EncryptedLinkHandshakeSnapshot { /* private fields */ }Expand description
Serializable snapshot of an in-progress
EncryptedLinkHandshake.
Serialize with serialize and restore with
restore_encrypted_link_handshake.
Snapshot bytes include sensitive key material and must be stored as secrets.
Implementations§
Source§impl EncryptedLinkHandshakeSnapshot
impl EncryptedLinkHandshakeSnapshot
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize to a compact binary format for durable storage.
The versioned envelope contains a length-delimited snapshot and at most one destination path with its exact, complete handshake packet.
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 pending_publication(
&self,
local_identity: &PublicKey,
local_noise_secret: &[u8; 32],
) -> Result<Option<(&str, &[u8])>>
pub fn pending_publication( &self, local_identity: &PublicKey, local_noise_secret: &[u8; 32], ) -> Result<Option<(&str, &[u8])>>
Read pending bytes only after checking the local key and identity-bound path.
This does not authorize publication: the caller must validate current authorization, recovery context, source checkpoint and lease atomically.
Sourcepub fn acknowledge_publication(
self,
destination_path: &str,
packet: &[u8],
) -> Result<Self>
pub fn acknowledge_publication( self, destination_path: &str, packet: &[u8], ) -> Result<Self>
Clear only the exact published packet; conditionally persist this result against the original pending checkpoint before advancing or exposing a link.
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 handshake’s stream paths.
Sourcepub fn next_handshake_read_path(
&self,
local_identity_public_key: &PublicKey,
local_noise_secret_key: &[u8; 32],
) -> Result<Option<String>>
pub fn next_handshake_read_path( &self, local_identity_public_key: &PublicKey, local_noise_secret_key: &[u8; 32], ) -> Result<Option<String>>
Return the next remote handshake resource without restoring Noise.
None means local work is required, not that the handshake is idle. The
returned path includes the counterparty identity and can be checked with
PublicStorage::exists after validating authorization and recovery state.
This advisory lookup neither authenticates a transcript nor advances it.
Before advancing, reload authoritative state under the ordinary lease.
Session authorization and key rotation remain the caller’s responsibility.