Skip to main content

verification_method_ml_dsa_65_keys

Function verification_method_ml_dsa_65_keys 

Source
pub fn verification_method_ml_dsa_65_keys(doc: &Value) -> Vec<MlDsaVerifyingKey> ⓘ
Expand description

Extract every ML-DSA-65 verifying key published in a DID document’s verificationMethod array (#579 multi-alg VM extraction).

The PQ counterpart to verification_method_ed25519_keys: it scans the same verificationMethod array but keeps the Multikey entries whose publicKeyMultibase carries the ml-dsa-65-pub multicodec (0x1211) — the mesh’s #mesh-pq verification method. Each candidate is decoded via the codec-agile decode_multikey and validated as a real ML-DSA-65 key by crate::crypto::pq::ml_dsa_vk_from_bytes (a malformed / wrong-length key is skipped, never trusted). Ed25519 (0xed01) VMs decode to a different codec and are skipped here, so the two extractors partition the same document by algorithm without interfering.

A document with no ML-DSA-65 VM yields an empty vec (the classical-only case): the caller treats “no PQ anchor” as Assurance::Classical, not an error.