pub enum PublicKey {
Ed25519(Box<[u8; 32]>),
MlDsa44(Box<[u8]>),
}Expand description
A public key resolved from a proof’s verificationMethod.
Variants§
Ed25519(Box<[u8; 32]>)
MlDsa44(Box<[u8]>)
An ML-DSA-44 key, as the 1312 bytes FIPS 204 encodes it in.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn to_spki_der(&self) -> Result<Vec<u8>, Error>
pub fn to_spki_der(&self) -> Result<Vec<u8>, Error>
The key as a DER SubjectPublicKeyInfo.
§Errors
Returns an error if an ML-DSA-44 key is not 1312 bytes long.
Sourcepub fn to_spki_pem(&self) -> Result<String, Error>
pub fn to_spki_pem(&self) -> Result<String, Error>
The key as an SPKI PEM, as OpenSSL’s public_to_pem writes it: a
PUBLIC KEY block, base64 in lines of 64, each ending in LF. This is
what Mastodon stores a remote actor’s Multikey as, and a FASP’s key.
§Errors
Trait Implementations§
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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.