You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Construct a new [`PeerRecord`] by authenticating the provided addresses with the given key.
62
62
///
63
-
/// This is the same key that is used for authenticating every libp2p connection of your application, i.e. what you use when setting up your [`crate::transport::Transport`].
63
+
/// This is the same key that is used for authenticating every libp2p connection of your
64
+
/// application, i.e. what you use when setting up your [`crate::transport::Transport`].
Copy file name to clipboardExpand all lines: core/src/signed_envelope.rs
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
-
usecrate::{proto,DecodeError};
2
-
use libp2p_identity::SigningError;
3
-
use libp2p_identity::{Keypair,PublicKey};
4
-
use quick_protobuf::{BytesReader,Writer};
5
1
use std::fmt;
2
+
3
+
use libp2p_identity::{Keypair,PublicKey,SigningError};
4
+
use quick_protobuf::{BytesReader,Writer};
6
5
use unsigned_varint::encode::usize_buffer;
7
6
8
-
/// A signed envelope contains an arbitrary byte string payload, a signature of the payload, and the public key that can be used to verify the signature.
7
+
usecrate::{proto,DecodeError};
8
+
9
+
/// A signed envelope contains an arbitrary byte string payload, a signature of the payload, and the
10
+
/// public key that can be used to verify the signature.
9
11
///
10
12
/// For more details see libp2p RFC0002: <https://github.com/libp2p/specs/blob/master/RFC/0002-signed-envelopes.md>
11
13
#[derive(Debug,Clone,PartialEq,Eq)]
@@ -46,8 +48,9 @@ impl SignedEnvelope {
46
48
47
49
/// Extract the payload and signing key of this [`SignedEnvelope`].
48
50
///
49
-
/// You must provide the correct domain-separation string and expected payload type in order to get the payload.
50
-
/// This guards against accidental mis-use of the payload where the signature was created for a different purpose or payload type.
51
+
/// You must provide the correct domain-separation string and expected payload type in order to
52
+
/// get the payload. This guards against accidental mis-use of the payload where the
53
+
/// signature was created for a different purpose or payload type.
51
54
///
52
55
/// It is the caller's responsibility to check that the signing key is what
53
56
/// is expected. For example, checking that the signing key is from a
@@ -156,7 +159,8 @@ pub enum DecodingError {
156
159
/// Errors that occur whilst extracting the payload of a [`SignedEnvelope`].
157
160
#[derive(Debug)]
158
161
pubenumReadPayloadError{
159
-
/// The signature on the signed envelope does not verify with the provided domain separation string.
162
+
/// The signature on the signed envelope does not verify
163
+
/// with the provided domain separation string.
160
164
InvalidSignature,
161
165
/// The payload contained in the envelope is not of the expected type.
0 commit comments