Skip to main content

receive_announcement

Function receive_announcement 

Source
pub fn receive_announcement(
    stream: &mut impl Read,
    store: &TrustStore,
    sender: &PeerIdentity,
) -> Result<PeerId, PeerError>
Expand description

Reads an announcement from sender (the verified peer of this connection) and records it in store as the pending successor of sender’s certificate. Returns the successor’s id. The next handshake that proves it promotes it, unless the store’s rotation options require approval.

§Errors

PeerError::Pairing with PairingError::Protocol for anything but an announcement of a certificate; PeerError::NotWaiting-style store errors as PeerError (an announcement by a peer that is not accepted, or retiring, is refused); PeerError::Io.