Skip to content

Commit 6be708b

Browse files
committed
Add sd-algorithms test file.
1 parent fad0e5d commit 6be708b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/90-algorithms-sd.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*!
2+
* Copyright 2024 Digital Bazaar, Inc.
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
import {endpoints} from 'vc-test-suite-implementations';
6+
import {getSuiteConfig} from './test-config.js';
7+
import {sd2023Algorithms} from './suites/algorithms-sd.js';
8+
9+
const cryptosuites = [
10+
'ecdsa-sd-2023',
11+
];
12+
13+
for(const suiteName of cryptosuites) {
14+
const {tags, credentials, vectors} = getSuiteConfig(suiteName);
15+
const {match: verifiers} = endpoints.filterByTag({
16+
tags: [...tags],
17+
property: 'verifiers'
18+
});
19+
const {match: issuers} = endpoints.filterByTag({
20+
tags: [...tags],
21+
property: 'issuers'
22+
});
23+
for(const vcVersion of vectors.vcTypes) {
24+
const {
25+
document,
26+
mandatoryPointers,
27+
selectivePointers
28+
} = credentials.create[vcVersion];
29+
sd2023Algorithms({
30+
verifiers,
31+
issuers,
32+
suiteName,
33+
keyTypes: vectors.keyTypes,
34+
vcVersion,
35+
credential: document,
36+
mandatoryPointers,
37+
selectivePointers
38+
});
39+
}
40+
}

0 commit comments

Comments
 (0)