Skip to content

Commit 53ecb66

Browse files
Add a param to createPresentation to make VC verification optional.
Signed-off-by: Dmitri Zagidulin <dzagidulin@gmail.com>
1 parent 7bd7d3a commit 53ecb66

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @digitalcredentials/vc ChangeLog
22

3+
## 10.0.1
4+
5+
### Changed
6+
- Add a parameter to `createPresentation` to allow VC verification to be optional.
7+
Addresses issue #32. Does not change current default behavior.
8+
39
## 10.0.0 - 2025-04-30
410

511
### Changed

lib/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ async function _verifyOBv3LegacySignature(credential,
419419
* @param {string|Date} [options.now] - A string representing date time in
420420
* ISO 8601 format or an instance of Date. Defaults to current date time.
421421
* @param {number} [options.version = 2.0] - The VC context version to use.
422+
* @param {boolean} [options.verify=true]
422423
*
423424
* @throws {TypeError} If verifiableCredential param is missing.
424425
* @throws {Error} If the credential (or the presentation params) are missing
@@ -428,7 +429,7 @@ async function _verifyOBv3LegacySignature(credential,
428429
* VerifiablePresentation.
429430
*/
430431
export function createPresentation({
431-
verifiableCredential, id, holder, now, version = 2.0
432+
verifiableCredential, id, holder, now, version = 2.0, verify = true
432433
} = {}) {
433434
const initialContext = (version === 2.0) ? CREDENTIALS_CONTEXT_V2_URL :
434435
CREDENTIALS_CONTEXT_V1_URL;
@@ -440,7 +441,8 @@ export function createPresentation({
440441
const credentials = [].concat(verifiableCredential);
441442
// ensure all credentials are valid
442443
for(const credential of credentials) {
443-
_checkCredential({credential, now});
444+
_checkCredential(
445+
{credential, now, mode: verify ? 'verify' : 'do not force verify'});
444446
}
445447
presentation.verifiableCredential = credentials;
446448
}

0 commit comments

Comments
 (0)