diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a15a073..6882a99e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @digitalcredentials/vc ChangeLog +## 10.0.1 + +### Changed +- Add a parameter to `createPresentation` to allow VC verification to be optional. + Addresses issue #32. Does not change current default behavior. + ## 10.0.0 - 2025-04-30 ### Changed diff --git a/lib/index.js b/lib/index.js index ff5305a5..262ef11f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -419,6 +419,7 @@ async function _verifyOBv3LegacySignature(credential, * @param {string|Date} [options.now] - A string representing date time in * ISO 8601 format or an instance of Date. Defaults to current date time. * @param {number} [options.version = 2.0] - The VC context version to use. + * @param {boolean} [options.verify=true] * * @throws {TypeError} If verifiableCredential param is missing. * @throws {Error} If the credential (or the presentation params) are missing @@ -428,7 +429,7 @@ async function _verifyOBv3LegacySignature(credential, * VerifiablePresentation. */ export function createPresentation({ - verifiableCredential, id, holder, now, version = 2.0 + verifiableCredential, id, holder, now, version = 2.0, verify = true } = {}) { const initialContext = (version === 2.0) ? CREDENTIALS_CONTEXT_V2_URL : CREDENTIALS_CONTEXT_V1_URL; @@ -440,7 +441,8 @@ export function createPresentation({ const credentials = [].concat(verifiableCredential); // ensure all credentials are valid for(const credential of credentials) { - _checkCredential({credential, now}); + _checkCredential( + {credential, now, mode: verify ? 'verify' : 'do not force verify'}); } presentation.verifiableCredential = credentials; }