pub struct VerifyingKey(pub(crate) VerifyingKey);Expand description
The public half of a SigningKey.
Tuple Fields§
§0: VerifyingKeyImplementations§
Source§impl VerifyingKey
impl VerifyingKey
Sourcepub fn to_multibase(&self) -> String
pub fn to_multibase(&self) -> String
The publicKeyMultibase value for a DID document verification method:
base58btc multibase over the multicodec prefix 0xE7 and the 33-byte
SEC1 compressed point.
Compression is requested explicitly here because k256 can produce
either form and an uncompressed key is not valid in atproto.
Sourcepub fn to_did_key(&self) -> String
pub fn to_did_key(&self) -> String
The did:key URI form: the did:key: prefix plus
VerifyingKey::to_multibase.
Sourcepub fn from_did_key(did: &str) -> Result<Self, KeyError>
pub fn from_did_key(did: &str) -> Result<Self, KeyError>
Parses a did:key:z... URI.
jacquard-common decodes bare multibase strings, not URIs, so the
prefix is stripped here.
Sourcepub fn from_multibase(multibase: &str) -> Result<Self, KeyError>
pub fn from_multibase(multibase: &str) -> Result<Self, KeyError>
Parses a bare publicKeyMultibase string.
Rejects any curve other than secp256k1 and any encoding other than the 33-byte compressed point, so that a key which round-trips through this crate is one atproto will accept.
Trait Implementations§
Source§impl Clone for VerifyingKey
impl Clone for VerifyingKey
Source§fn clone(&self) -> VerifyingKey
fn clone(&self) -> VerifyingKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VerifyingKey
impl Debug for VerifyingKey
Source§impl PartialEq for VerifyingKey
impl PartialEq for VerifyingKey
Source§fn eq(&self, other: &VerifyingKey) -> bool
fn eq(&self, other: &VerifyingKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for VerifyingKey
impl Eq for VerifyingKey
impl StructuralPartialEq for VerifyingKey
Auto Trait Implementations§
impl Freeze for VerifyingKey
impl RefUnwindSafe for VerifyingKey
impl Send for VerifyingKey
impl Sync for VerifyingKey
impl Unpin for VerifyingKey
impl UnsafeUnpin for VerifyingKey
impl UnwindSafe for VerifyingKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.