pub struct PublicKey(/* private fields */);Expand description
A public key.
Create using SecretKey::public_key.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn recover_from_prehash(
prehash: &[u8],
signature: &RecoverableSignature,
) -> Result<Self, String>
pub fn recover_from_prehash( prehash: &[u8], signature: &RecoverableSignature, ) -> Result<Self, String>
Recovers the public key from a prehashed message and the corresponding recoverable signature.
Sourcepub fn try_from_compressed_bytes(bytes: &[u8]) -> Result<Self, String>
pub fn try_from_compressed_bytes(bytes: &[u8]) -> Result<Self, String>
Restores the public key from a compressed curve point.
Sourcepub fn to_compressed_bytes(self) -> Box<[u8]>
pub fn to_compressed_bytes(self) -> Box<[u8]>
Retunrs the serialized pubic key as the compressed curve point.
Sourcepub fn to_uncompressed_bytes(self) -> Box<[u8]>
pub fn to_uncompressed_bytes(self) -> Box<[u8]>
Retunrs the serialized pubic key as the uncompressed curve point.
Trait Implementations§
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>(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 TryFromBytes for PublicKey
Available on crate feature serde only.
impl TryFromBytes for PublicKey
Available on crate feature
serde only.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<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