pub fn assertion_key(
document: &Value,
did: &str,
verification_method: &str,
algorithm: &str,
) -> Result<Vec<u8>>Expand description
The raw public key a proof names, when document lets did use it for
assertions. Every rule must hold, or the key is refused:
- the document’s
idis exactlydid; verification_methodisdidplus a fragment (or just the fragment), and exactly one method in the document has that id (ids written relative to the document, “#key-1”, count);- the method’s
controllerisdid; - the method is listed in
assertionMethod, by reference (absolute or relative) or embedded there; - the method carries one kind of key material, of the right kind:
MultikeyorEd25519VerificationKey2020withpublicKeyMultibase, orJsonWebKey2020/JsonWebKey(or the earlierEd25519VerificationKey2020) with a public Ed25519publicKeyJwkmeant for signatures; - the key is a well-formed
algorithmkey (ED25519,MLDSA44orSLHDSA128), decoded strictly.