diff --git a/lib/index.js b/lib/index.js index 262ef11f..c368eca5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -419,7 +419,8 @@ 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] + * @param {boolean} [options.verify=true] - If set to true, throw verification + * errors for individual VCs (such as when the VC is expired, etc). * * @throws {TypeError} If verifiableCredential param is missing. * @throws {Error} If the credential (or the presentation params) are missing @@ -439,11 +440,15 @@ export function createPresentation({ }; if(verifiableCredential) { const credentials = [].concat(verifiableCredential); - // ensure all credentials are valid - for(const credential of credentials) { - _checkCredential( - {credential, now, mode: verify ? 'verify' : 'do not force verify'}); + + if(verify) { + // ensure all credentials are valid and verified + for(const credential of credentials) { + _checkCredential( + {credential, now, mode: verify ? 'verify' : 'do not force verify'}); + } } + presentation.verifiableCredential = credentials; } if(id) {