Enum sc_network::PublicKey
pub enum PublicKey {
Ed25519(PublicKey),
}
Expand description
The public key of a node’s identity keypair.
Variants§
Ed25519(PublicKey)
👎Deprecated since 0.1.0: This enum will be made opaque in the future, use
PublicKey::from
and PublicKey::into_ed25519
instead.A public Ed25519 key.
Implementations§
§impl PublicKey
impl PublicKey
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
Verify a signature for a message using this public key, i.e. check that the signature has been produced by the corresponding private key (authenticity), and that the message has not been tampered with (integrity).
pub fn into_ed25519(self) -> Option<PublicKey>
👎Deprecated: This method name does not follow Rust naming conventions, use
PublicKey::try_into_ed25519
instead.pub fn try_into_ed25519(self) -> Result<PublicKey, OtherVariantError>
pub fn to_protobuf_encoding(&self) -> Vec<u8, Global> ⓘ
👎Deprecated: Renamed to PublicKey::encode_protobuf
.
pub fn to_protobuf_encoding(&self) -> Vec<u8, Global> ⓘ
PublicKey::encode_protobuf
.Encode the public key into a protobuf structure for storage or exchange with other nodes.
pub fn encode_protobuf(&self) -> Vec<u8, Global> ⓘ
pub fn encode_protobuf(&self) -> Vec<u8, Global> ⓘ
Encode the public key into a protobuf structure for storage or exchange with other nodes.
pub fn from_protobuf_encoding(bytes: &[u8]) -> Result<PublicKey, DecodingError>
👎Deprecated: This method name does not follow Rust naming conventions, use PublicKey::try_decode_protobuf
instead.
pub fn from_protobuf_encoding(bytes: &[u8]) -> Result<PublicKey, DecodingError>
PublicKey::try_decode_protobuf
instead.Decode a public key from a protobuf structure, e.g. read from storage or received from another node.
pub fn try_decode_protobuf(bytes: &[u8]) -> Result<PublicKey, DecodingError>
pub fn try_decode_protobuf(bytes: &[u8]) -> Result<PublicKey, DecodingError>
Decode a public key from a protobuf structure, e.g. read from storage or received from another node.
pub fn to_peer_id(&self) -> PeerId
pub fn to_peer_id(&self) -> PeerId
Convert the PublicKey
into the corresponding PeerId
.
Trait Implementations§
§impl Ord for PublicKey
impl Ord for PublicKey
§impl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> for PublicKey
§fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.