pub struct PublicKey(/* private fields */);Expand description
Wrapper around pkarr::PublicKey that renders with the pubky prefix.
Note: serde/transport/database formats continue to use raw z32 strings. Use
PublicKey::z32() for hostnames, query parameters, storage, and wire formats.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn is_pubky_prefixed(value: &str) -> bool
pub fn is_pubky_prefixed(value: &str) -> bool
Returns true if the value is in pubky<z32> form.
Sourcepub const fn as_inner(&self) -> &PublicKey
pub const fn as_inner(&self) -> &PublicKey
Borrow the inner pkarr::PublicKey.
Sourcepub fn into_inner(self) -> PublicKey
pub fn into_inner(self) -> PublicKey
Extract the inner pkarr::PublicKey.
Methods from Deref<Target = PublicKey>§
Sourcepub fn to_uri_string(&self) -> String
pub fn to_uri_string(&self) -> String
Format the public key as pk: URI string.
Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verify a signature over a message.
Sourcepub fn verifying_key(&self) -> &VerifyingKey
pub fn verifying_key(&self) -> &VerifyingKey
Return a reference to the underlying VerifyingKey
Trait Implementations§
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
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