• Retrieves all verification methods from a given DID document, including embedded methods.

    This function consolidates all verification methods into a single array for easy access and processing. It checks both the primary verificationMethod array and the individual verification relationship properties authentication, assertionMethod, keyAgreement, capabilityInvocation, and capabilityDelegation for embedded methods.

    The given DID Document must adhere to the W3C DID Core Specification.

    Parameters

    • params: {
          didDocument: DidDocument;
      }

      An object containing input parameters for retrieving verification methods.

      • didDocument: DidDocument

        The DID document from which verification methods are retrieved.

    Returns DidVerificationMethod[]

    An array of DidVerificationMethod. If no verification methods are found, an empty array is returned.

    Example

    const didDocument = { ... }; // W3C DID document
    const verificationMethods = getVerificationMethods({ didDocument });

    Throws

    Throws an TypeError if the didDocument parameter is missing.