pub enum MessageAuthenticity {
    Signed(Keypair),
    Author(PeerId),
    RandomAuthor,
    Anonymous,
}
Expand description

Determines if published messages should be signed or not.

Without signing, a number of privacy preserving modes can be selected.

NOTE: The default validation settings are to require signatures. The ValidationMode should be updated in the GossipsubConfig to allow for unsigned messages.

Variants

Signed(Keypair)

Message signing is enabled. The author will be the owner of the key and the sequence number will be a random number.

Author(PeerId)

Message signing is disabled.

The specified PeerId will be used as the author of all published messages. The sequence number will be randomized.

RandomAuthor

Message signing is disabled.

A random PeerId will be used when publishing each message. The sequence number will be randomized.

Anonymous

Message signing is disabled.

The author of the message and the sequence numbers are excluded from the message.

NOTE: Excluding these fields may make these messages invalid by other nodes who enforce validation of these fields. See ValidationMode in the GossipsubConfig for how to customise this for rust-libp2p gossipsub. A custom message_id function will need to be set to prevent all messages from a peer being filtered as duplicates.

Implementations

Returns true if signing is enabled.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.