pub struct KeriPublicKey(/* private fields */);Expand description
A validated KERI Ed25519 public key (32 bytes).
Args:
- The inner
[u8; 32]is the raw Ed25519 public key bytes, decoded from a KERI CESR-encoded string with ‘D’ derivation code prefix.
Usage:
use auths_crypto::KeriPublicKey;
let key = KeriPublicKey::parse("DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").unwrap();
assert_eq!(key.as_bytes(), &[0u8; 32]);Implementations§
Source§impl KeriPublicKey
impl KeriPublicKey
Sourcepub fn parse(encoded: &str) -> Result<Self, KeriDecodeError>
pub fn parse(encoded: &str) -> Result<Self, KeriDecodeError>
Parses a KERI-encoded Ed25519 public key string into a validated type.
The input must be a ‘D’-prefixed base64url-no-pad encoded 32-byte Ed25519 key, as defined by the KERI CESR specification.
Args:
encoded: The KERI-encoded string (e.g.,"D<base64url>").
Usage:
use auths_crypto::KeriPublicKey;
let key = KeriPublicKey::parse("DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").unwrap();
let raw = key.as_bytes();Sourcepub fn into_bytes(self) -> [u8; 32]
pub fn into_bytes(self) -> [u8; 32]
Consumes self and returns the inner 32-byte array.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeriPublicKey
impl RefUnwindSafe for KeriPublicKey
impl Send for KeriPublicKey
impl Sync for KeriPublicKey
impl Unpin for KeriPublicKey
impl UnsafeUnpin for KeriPublicKey
impl UnwindSafe for KeriPublicKey
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