The verifyPresentation
function is an asynchronous method designed to validate the authenticity and integrity of a Verifiable Presentation (VP). This function ensures that the VP contains valid proofs, that the credentials included in the presentation are not revoked or expired, and that the presentation adheres to the required standards and criteria set forth for verification.
vp
(VerifiablePresentation): The Verifiable Presentation object that needs to be verified. This object includes the presentation’s details such as the holder’s identifier, the Verifiable Credentials included, and the cryptographic proofs that verify the integrity and origin of the presentation.options
(VerificationOptions, optional): Configuration options for the verification process. These may include:
revocationRegistryAddress
(ethers.AddressLike, optional): The address of the smart contract that handles credential revocation.provider
(ethers.Provider, optional): The blockchain provider through which blockchain interactions are performed.mandatoryFields
(string[], optional): A list of mandatory fields that must be included in the presentation’s proof checking.Promise<boolean>
: A promise that resolves to true if the presentation is verified successfully, or false if the verification fails. Reasons for failure may include invalid or expired proofs, revoked credentials, or failure to meet the specified mandatory fields.