Enum libp2p_core::PublicKey
source · Expand description
Public key used by the remote.
Variants
Rsa(Vec<u8>)
DER format.
Ed25519(Vec<u8>)
Format = ???
Secp256k1(Vec<u8>)
Format = ???
Implementations
sourceimpl PublicKey
impl PublicKey
sourcepub fn into_protobuf_encoding(self) -> Vec<u8>
pub fn into_protobuf_encoding(self) -> Vec<u8>
Encodes the public key as a protobuf message.
Used at various locations in the wire protocol of libp2p.
sourcepub fn from_protobuf_encoding(bytes: &[u8]) -> Result<PublicKey, IoError>
pub fn from_protobuf_encoding(bytes: &[u8]) -> Result<PublicKey, IoError>
Decodes the public key from a protobuf message.
Used at various locations in the wire protocol of libp2p.
sourcepub fn into_peer_id(self) -> PeerId
pub fn into_peer_id(self) -> PeerId
Builds a PeerId
corresponding to the public key of the node.
Trait Implementations
impl Eq for PublicKey
impl StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more