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§
source§impl PublicKey
impl PublicKey
sourcepub fn from_near_implicit_account(
account_id: &AccountId
) -> Result<Self, ImplicitPublicKeyError>
pub fn from_near_implicit_account( account_id: &AccountId ) -> Result<Self, ImplicitPublicKeyError>
Create the implicit public key from an NEAR-implicit account ID.
Returns ImplicitPublicKeyError::AccountIsNotNearImplicit
if the given
account id is not a valid NEAR-implicit account ID.
See near_account_id::AccountId
for the definition.
Trait Implementations§
source§impl BorshDeserialize for PublicKey
impl BorshDeserialize for PublicKey
fn deserialize_reader<R: Read>(rd: &mut R) -> Result<Self>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for PublicKey
impl BorshSerialize for PublicKey
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
source§fn 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
source§impl From<ED25519PublicKey> for PublicKey
impl From<ED25519PublicKey> for PublicKey
source§fn from(ed25519: ED25519PublicKey) -> Self
fn from(ed25519: ED25519PublicKey) -> Self
Converts to this type from the input type.
source§impl From<Secp256K1PublicKey> for PublicKey
impl From<Secp256K1PublicKey> for PublicKey
source§fn from(secp256k1: Secp256K1PublicKey) -> Self
fn from(secp256k1: Secp256K1PublicKey) -> Self
Converts to this type from the input type.
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialEq for PublicKey
impl PartialEq for PublicKey
source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
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 moresource§impl Serialize for PublicKey
impl Serialize for PublicKey
source§fn 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§
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