#[non_exhaustive]pub enum KeyCodec {
Ed25519Pub,
X25519Pub,
Secp256k1Pub,
}Expand description
Multicodec key codecs used by did:bio verification methods.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ed25519Pub
ed25519-pub, multicodec 0xed, a 32 byte key encoded as z6Mk....
X25519Pub
x25519-pub, multicodec 0xec, a 32 byte key encoded as z6LS....
Secp256k1Pub
secp256k1-pub, multicodec 0xe7, a 33 byte compressed key encoded
as zQ3s....
Implementations§
Source§impl KeyCodec
impl KeyCodec
Sourcepub const fn multicodec(self) -> u64
pub const fn multicodec(self) -> u64
The multicodec code point.
Sourcepub const fn multibase_prefix(self) -> &'static str
pub const fn multibase_prefix(self) -> &'static str
The characteristic multibase prefix of encoded keys. It is informative (spec Section 5.2 table).
Trait Implementations§
impl Copy for KeyCodec
impl Eq for KeyCodec
impl StructuralPartialEq for KeyCodec
Auto Trait Implementations§
impl Freeze for KeyCodec
impl RefUnwindSafe for KeyCodec
impl Send for KeyCodec
impl Sync for KeyCodec
impl Unpin for KeyCodec
impl UnsafeUnpin for KeyCodec
impl UnwindSafe for KeyCodec
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