An object containing input parameters for retrieving the verification method ID.
The DID document to search for the verification method.
Optional
publicThe public key in JSON Web Key (JWK) format to match against the verification methods in the DID document.
Optional
publicThe public key as a multibase encoded string to match against the verification methods in the DID document.
A promise that resolves with the matching verification method, or null
if no match is found.
const didDocument = {
// ... contents of a DID document ...
};
const publicKeyJwk = { kty: 'OKP', crv: 'Ed25519', x: '...' };
const verificationMethod = await getVerificationMethodByKey({
didDocument,
publicKeyJwk
});
Throws an Error
if the didDocument
parameter is missing or if the didDocument
does not contain any verification methods.
Retrieves a verification method object from a DID document if there is a match for the given public key.
This function searches the verification methods in a given DID document for a match with the provided public key (either in JWK or multibase format). If a matching verification method is found it is returned. If no match is found
null
is returned.