Skip to main content

verification_method_ed25519_keys

Function verification_method_ed25519_keys 

Source
pub fn verification_method_ed25519_keys(doc: &Value) -> Vec<[u8; 32]>
Expand description

Extract every Ed25519 public key published in a DID document’s verificationMethod array, decoded to raw 32-byte keys (#137 stage 2).

Only Multikey / Ed25519VerificationKey2020-shaped entries with a publicKeyMultibase carrying the ed25519-pub multicodec are returned (the identity VMs such as #mesh). Entries with a different codec, a non-multibase encoding (e.g. publicKeyJwk-only), or that fail to decode are skipped — a malformed VM must not be admitted, and a doc with no Ed25519 VM yields an empty vec (the caller treats empty as “no match → reject”, preserving §4.4 fail-closed posture).