pub struct PublicKey(pub VerifyingKey);
Expand description
This is a public key, which identifies an actor (usually a person) and is shared.
Tuple Fields§
§0: VerifyingKey
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn as_hex_string(&self) -> String
pub fn as_hex_string(&self) -> String
Render into a hexadecimal string
Consider converting .into()
a PublicKeyHex
which is a wrapped type rather than a naked String
Sourcepub fn try_from_hex_string(v: &str) -> Result<PublicKey, Error>
pub fn try_from_hex_string(v: &str) -> Result<PublicKey, Error>
Create from a hexadecimal string
Sourcepub fn try_as_bech32_string(&self) -> Result<String, Error>
pub fn try_as_bech32_string(&self) -> Result<String, Error>
Export as a bech32 encoded string
Methods from Deref<Target = VerifyingKey>§
Sourcepub fn as_affine(&self) -> &AffinePoint
pub fn as_affine(&self) -> &AffinePoint
Borrow the inner AffinePoint
this type wraps.
Sourcepub fn to_bytes(&self) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>
pub fn to_bytes(&self) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>
Serialize as bytes.
Sourcepub fn verify_raw(
&self,
message: &[u8],
signature: &Signature,
) -> Result<(), Error>
pub fn verify_raw( &self, message: &[u8], signature: &Signature, ) -> Result<(), Error>
Compute Schnorr signature.
§⚠️ Warning
This is a low-level interface intended only for unusual use cases involving verifying pre-hashed messages, or “raw” messages where the message is not hashed at all prior to being used to generate the Schnorr signature.
The preferred interfaces are the DigestVerifier
or PrehashVerifier
traits.
Trait Implementations§
Source§impl AsMut<VerifyingKey> for PublicKey
impl AsMut<VerifyingKey> for PublicKey
Source§fn as_mut(&mut self) -> &mut VerifyingKey
fn as_mut(&mut self) -> &mut VerifyingKey
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<VerifyingKey> for PublicKey
impl AsRef<VerifyingKey> for PublicKey
Source§fn as_ref(&self) -> &VerifyingKey
fn as_ref(&self) -> &VerifyingKey
Converts this type into a shared reference of the (usually inferred) input type.
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 From<PublicKey> for PublicKeyHex
impl From<PublicKey> for PublicKeyHex
Source§fn from(pk: PublicKey) -> PublicKeyHex
fn from(pk: PublicKey) -> PublicKeyHex
Converts to this type from the input type.
Source§impl From<PublicKey> for VerifyingKey
impl From<PublicKey> for VerifyingKey
Source§impl From<VerifyingKey> for PublicKey
impl From<VerifyingKey> for PublicKey
Source§fn from(original: VerifyingKey) -> PublicKey
fn from(original: VerifyingKey) -> PublicKey
Converts to this type from the input type.
Source§impl TryFrom<PublicKeyHex> for PublicKey
impl TryFrom<PublicKeyHex> 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<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