Struct rings_core::ecc::PublicKey
source · pub struct PublicKey(pub [u8; 33]);Expand description
PublicKey for ECDSA and EdDSA.
Tuple Fields§
§0: [u8; 33]Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn try_from_b58t(value: &str) -> Result<PublicKey>
pub fn try_from_b58t(value: &str) -> Result<PublicKey>
trezor style b58
sourcepub fn try_from_b58m(value: &str) -> Result<PublicKey>
pub fn try_from_b58m(value: &str) -> Result<PublicKey>
monero and bitcoin style b58
sourcepub fn try_from_b58m_uncheck(value: &str) -> Result<PublicKey>
pub fn try_from_b58m_uncheck(value: &str) -> Result<PublicKey>
monero style uncheck base56
sourcepub fn from_u8(value: &[u8]) -> Result<PublicKey>
pub fn from_u8(value: &[u8]) -> Result<PublicKey>
from raw u8, the length can be 32, or 33 Odd flag can be “02” (odd), “03” (even) or “00” (unknown) The format is <odd_flat (1 bytes), x_cordinate (32 bytes)> For 32 bytes case, we mark the odd flas as 00 (unknown) For 64 bytes case, we compress the public key into compressed public key
sourcepub fn to_base58_string(&self) -> Result<String>
pub fn to_base58_string(&self) -> Result<String>
convert pubkey to base58_string
sourcepub fn from_hex_string(value: &str) -> Result<Self>
pub fn from_hex_string(value: &str) -> Result<Self>
convert public_key from hex string
source§impl PublicKey
impl PublicKey
sourcepub fn ct_into_secp256r1_affine(self) -> CtOption<AffinePoint<NistP256>>
pub fn ct_into_secp256r1_affine(self) -> CtOption<AffinePoint<NistP256>>
Map a PublicKey into secp256r1 affine point, This function is an constant-time cryptographic implementations
sourcepub fn ct_try_into_secp256r1_pubkey(
self
) -> CtOption<Result<VerifyingKey<NistP256>>>
pub fn ct_try_into_secp256r1_pubkey( self ) -> CtOption<Result<VerifyingKey<NistP256>>>
Map a PublicKey into secp256r1 public key, This function is an constant-time cryptographic implementations
Trait Implementations§
source§impl AffineCoordinates for PublicKey
impl AffineCoordinates for PublicKey
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for PublicKey
impl PartialEq for PublicKey
impl Copy for PublicKey
impl Eq for PublicKey
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 UnwindSafe for PublicKey
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more