7
7
generators ,
8
8
issueCloned
9
9
} from 'data-integrity-test-suite-assertion' ;
10
+ import { DataIntegrityProof } from '@digitalbazaar/data-integrity' ;
10
11
import { getMultiKey } from '../vc-generator/key-gen.js' ;
12
+ import { getSuite } from '../vc-generator/cryptosuites.js' ;
11
13
12
14
export function assertConformance ( {
13
15
verifiers,
@@ -40,6 +42,13 @@ export function assertConformance({
40
42
'Data Model and 3. Algorithms of this document MUST be enforced.' ,
41
43
async function ( ) {
42
44
this . test . link = 'https://w3c.github.io/vc-di-ecdsa/#:~:text=Specifically%2C%20all%20relevant%20normative%20statements%20in%20Sections%202.%20Data%20Model%20and%203.%20Algorithms%20of%20this%20document%20MUST%20be%20enforced.' ;
45
+ for ( const [ key , credential ] of credentials ) {
46
+ await assertions . verificationFail ( {
47
+ verifier,
48
+ credential,
49
+ reason : `Should not verify VC with ${ key } `
50
+ } ) ;
51
+ }
43
52
} ) ;
44
53
it ( 'Conforming processors MUST produce errors when non-conforming ' +
45
54
'documents are consumed.' , async function ( ) {
@@ -60,7 +69,6 @@ async function _setup({
60
69
credential,
61
70
suiteName,
62
71
keyType,
63
- cryptosuite,
64
72
mandatoryPointers,
65
73
selectivePointers
66
74
} ) {
@@ -75,14 +83,59 @@ async function _setup({
75
83
// not bs58 encoded verificationMethod via invalidVm
76
84
// type is not DataIntegrityProof invalidType
77
85
// invalid cryptosuite name invalidCryptosuite
78
- credentials . set ( 'invalidCryptosuite' , await issueCloned ( invalidCryptosuite ( {
79
-
86
+ credentials . set ( 'invalid cryptosuite' , await issueCloned ( invalidCryptosuite ( {
87
+ credential : structuredClone ( credential ) ,
88
+ ..._getSuites ( {
89
+ signer,
90
+ suiteName,
91
+ selectivePointers,
92
+ mandatoryPointers
93
+ } )
80
94
} ) ) ) ;
81
- credentials . set ( 'invalidVerificationMethod' , await issueCloned ( invalidVm ( {
82
-
95
+ credentials . set ( 'invalid VerificationMethod' , await issueCloned ( invalidVm ( {
96
+ credential : structuredClone ( credential ) ,
97
+ ..._getSuites ( {
98
+ signer,
99
+ suiteName,
100
+ selectivePointers,
101
+ mandatoryPointers
102
+ } )
83
103
} ) ) ) ;
84
- credentials . set ( 'invalidProofType' , await issueCloned ( invalidProofType ( {
85
-
104
+ credentials . set ( 'invalid Proof Type' , await issueCloned ( invalidProofType ( {
105
+ credential : structuredClone ( credential ) ,
106
+ ..._getSuites ( {
107
+ signer,
108
+ suiteName,
109
+ selectivePointers,
110
+ mandatoryPointers
111
+ } )
86
112
} ) ) ) ;
87
113
return credentials ;
88
114
}
115
+
116
+ function _getSuites ( {
117
+ signer,
118
+ suiteName,
119
+ mandatoryPointers,
120
+ selectivePointers
121
+ } ) {
122
+ const suites = {
123
+ suite : new DataIntegrityProof ( {
124
+ signer,
125
+ cryptosuite : getSuite ( {
126
+ suite : suiteName ,
127
+ mandatoryPointers
128
+ } )
129
+ } )
130
+ } ;
131
+ if ( selectivePointers ) {
132
+ suites . selectiveSuite = new DataIntegrityProof ( {
133
+ signer,
134
+ cryptosuite : getSuite ( {
135
+ suite : suiteName ,
136
+ selectivePointers
137
+ } )
138
+ } ) ;
139
+ }
140
+ return suites ;
141
+ }
0 commit comments