ResolvedDocumentId
Binds a resolved DID document to the DID that was asked for.
A resolver that fetches a document from an external source (a node, a gateway, a universal resolver) must check that document.id is the DID that was requested. Otherwise a malicious or misbehaving source can return another subject's document (with that subject's keys) for the requested DID, and a caller that trusts the result attributes the wrong keys to the DID. See DID Resolution: the id of the returned document is the DID being resolved.
On mismatch callers must reject the result with the invalidDidDocument error. They must never rewrite the id to the requested DID, and never cache the document under either DID.
Functions
Returns null when documentId is acceptable for requestedDid, otherwise a human-readable reason.