Enum near_crypto::PublicKey
source · [−]pub enum PublicKey {
ED25519(ED25519PublicKey),
SECP256K1(Secp256K1PublicKey),
}
Expand description
Public key container supporting different curves.
Variants
ED25519(ED25519PublicKey)
256 bit elliptic curve based public-key.
SECP256K1(Secp256K1PublicKey)
512 bit elliptic curve based public-key used in Bitcoin’s public-key cryptography.
Implementations
Trait Implementations
sourceimpl BorshDeserialize for PublicKey
impl BorshDeserialize for PublicKey
sourceimpl BorshSerialize for PublicKey
impl BorshSerialize for PublicKey
sourceimpl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
sourcefn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<ED25519PublicKey> for PublicKey
impl From<ED25519PublicKey> for PublicKey
sourcefn from(ed25519: ED25519PublicKey) -> Self
fn from(ed25519: ED25519PublicKey) -> Self
Converts to this type from the input type.
sourceimpl From<Secp256K1PublicKey> for PublicKey
impl From<Secp256K1PublicKey> for PublicKey
sourcefn from(secp256k1: Secp256K1PublicKey) -> Self
fn from(secp256k1: Secp256K1PublicKey) -> Self
Converts to this type from the input type.
sourceimpl Ord for PublicKey
impl Ord for PublicKey
sourceimpl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> for PublicKey
sourcefn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Serialize for PublicKey
impl Serialize for PublicKey
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more