pub struct PublicKey(/* private fields */);Expand description
secp256k1 public key backed by sp_core::ecdsa::Public (compressed form).
Implementations§
Source§impl PublicKey
impl PublicKey
pub fn from_private(private_key: &PrivateKey) -> PublicKey
pub fn from_bytes(bytes: [u8; 33]) -> Result<PublicKey, SignerError>
pub fn to_bytes(self) -> [u8; 33]
pub fn to_hex(self) -> String
pub fn to_address(self) -> Address
pub fn to_uncompressed(self) -> [u8; 64]
Trait Implementations§
impl Copy for PublicKey
Source§impl<'de> Deserialize<'de> for PublicKey
Available on crate feature serde only.
impl<'de> Deserialize<'de> for PublicKey
Available on crate feature
serde only.Source§fn deserialize<D>(d: D) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<PublicKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PublicKey
Source§impl From<&PrivateKey> for PublicKey
impl From<&PrivateKey> for PublicKey
Source§fn from(private_key: &PrivateKey) -> PublicKey
fn from(private_key: &PrivateKey) -> PublicKey
Converts to this type from the input type.
Source§impl From<CryptoBytes<sp_core::::ecdsa::Public::{constant#0}, (PublicTag, EcdsaTag)>> for PublicKey
impl From<CryptoBytes<sp_core::::ecdsa::Public::{constant#0}, (PublicTag, EcdsaTag)>> for PublicKey
Source§impl From<PrivateKey> for PublicKey
impl From<PrivateKey> for PublicKey
Source§fn from(private_key: PrivateKey) -> PublicKey
fn from(private_key: PrivateKey) -> PublicKey
Converts to this type from the input type.
Source§impl Ord for PublicKey
impl Ord for PublicKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
Source§impl Serialize for PublicKey
Available on crate feature serde only.
impl Serialize for PublicKey
Available on crate feature
serde only.Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
impl<T> JsonSchemaMaybe for T
impl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeRefUnwindSafe for Twhere
T: RefUnwindSafe,
Source§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.