pub struct PublicKey<const SIZE: usize>(pub [u8; SIZE]);Expand description
PublicKey for ECDSA and EdDSA.
Tuple Fields§
§0: [u8; SIZE]Implementations§
Source§impl PublicKey<33>
impl PublicKey<33>
Sourcepub fn try_from_b58t(value: &str) -> Result<PublicKey<33>>
pub fn try_from_b58t(value: &str) -> Result<PublicKey<33>>
trezor style b58
Sourcepub fn try_from_b58m(value: &str) -> Result<PublicKey<33>>
pub fn try_from_b58m(value: &str) -> Result<PublicKey<33>>
monero and bitcoin style b58
Sourcepub fn try_from_b58m_uncheck(value: &str) -> Result<PublicKey<33>>
pub fn try_from_b58m_uncheck(value: &str) -> Result<PublicKey<33>>
monero style uncheck base56
Sourcepub fn from_u8(value: &[u8]) -> Result<PublicKey<33>>
pub fn from_u8(value: &[u8]) -> Result<PublicKey<33>>
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_coordinate (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<PublicKey<33>>
pub fn from_hex_string(value: &str) -> Result<PublicKey<33>>
convert public_key from hex string
Source§impl<const SIZE: usize> PublicKey<SIZE>
impl<const SIZE: usize> PublicKey<SIZE>
Sourcepub fn from_exact_u8(value: &[u8]) -> Result<PublicKey<SIZE>>
pub fn from_exact_u8(value: &[u8]) -> Result<PublicKey<SIZE>>
Build a public key from exactly SIZE bytes.
Source§impl PublicKey<33>
impl PublicKey<33>
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<33>
impl AffineCoordinates for PublicKey<33>
impl<const SIZE: usize> Copy for PublicKey<SIZE>
Source§impl<'de, const SIZE: usize> Deserialize<'de> for PublicKey<SIZE>
impl<'de, const SIZE: usize> Deserialize<'de> for PublicKey<SIZE>
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
impl<const SIZE: usize> Eq for PublicKey<SIZE>
Source§impl From<VerifyingKey> for PublicKey<33>
impl From<VerifyingKey> for PublicKey<33>
Source§fn from(key: VerifyingKey) -> Self
fn from(key: VerifyingKey) -> Self
Converts to this type from the input type.
Source§impl<const SIZE: usize> PartialEq for PublicKey<SIZE>
impl<const SIZE: usize> PartialEq for PublicKey<SIZE>
impl<const SIZE: usize> StructuralPartialEq for PublicKey<SIZE>
Source§impl TryFrom<Projective<<Config as Bls12Config>::G1Config>> for PublicKey<48>
impl TryFrom<Projective<<Config as Bls12Config>::G1Config>> for PublicKey<48>
Source§impl TryFrom<PublicKey<33>> for VerifyingKey
impl TryFrom<PublicKey<33>> for VerifyingKey
Auto Trait Implementations§
impl<const SIZE: usize> Freeze for PublicKey<SIZE>
impl<const SIZE: usize> RefUnwindSafe for PublicKey<SIZE>
impl<const SIZE: usize> Send for PublicKey<SIZE>
impl<const SIZE: usize> Sync for PublicKey<SIZE>
impl<const SIZE: usize> Unpin for PublicKey<SIZE>
impl<const SIZE: usize> UnsafeUnpin for PublicKey<SIZE>
impl<const SIZE: usize> UnwindSafe for PublicKey<SIZE>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.