99} from './assertions.js' ;
1010import {
1111 generateCredential ,
12+ inspectSdProofValue ,
1213 isValidDatetime ,
1314 proofExists ,
1415 secureCredential ,
@@ -43,16 +44,17 @@ describe('Algorithms - Create Base Proof (ecdsa-sd-2023)', function() {
4344 const [ issuer ] = endpoints ;
4445 let securedCredential ;
4546 before ( async function ( ) {
47+ const mandatoryPointers = [ '/credentialSubject/name' ] ;
4648 securedCredential = await secureCredential (
47- { issuer, vc : generateCredential ( ) } ) ;
49+ { issuer, vc : generateCredential ( ) , mandatoryPointers } ) ;
4850 } ) ;
4951 beforeEach ( setupRow ) ;
5052 it ( 'A data integrity proof (map), or an error, is produced as output.' ,
5153 async function ( ) {
5254 this . test . link = 'https://www.w3.org/TR/vc-di-ecdsa/#create-proof-ecdsa-sd-2023' ;
5355 const proof = proofExists ( securedCredential ) ;
54- assertDataIntegrityProof ( proof , 'ecdsa-sd-2023' ) ;
55- // Since we are not sending proof options, we only do a positive test
56+ assertDataIntegrityProof ( proof ) ;
57+ // We only do a positive test
5658 } ) ;
5759 it ( 'Let proof.proofValue be a base64-url-encoded ' +
5860 'Multibase value of the proofBytes.' ,
@@ -77,8 +79,9 @@ describe('Algorithms - Base Proof Transformation (ecdsa-sd-2023)', function() {
7779 const [ issuer ] = endpoints ;
7880 let securedCredential ;
7981 before ( async function ( ) {
82+ const mandatoryPointers = [ '/credentialSubject/name' ] ;
8083 securedCredential = await secureCredential (
81- { issuer, vc : generateCredential ( ) } ) ;
84+ { issuer, vc : generateCredential ( ) , mandatoryPointers } ) ;
8285 } ) ;
8386 beforeEach ( setupRow ) ;
8487 it ( 'The transformation options MUST contain a type identifier for the ' +
@@ -99,7 +102,14 @@ describe('Algorithms - Base Proof Transformation (ecdsa-sd-2023)', function() {
99102 'options, such as a JSON-LD document loader.' ,
100103 async function ( ) {
101104 this . test . link = 'https://www.w3.org/TR/vc-di-ecdsa/#transformation-ecdsa-sd-2023' ;
102- this . skip ( ) ;
105+ // Send an issuance request without mandatoryPointers
106+ const securedCredentialNoPointers = await secureCredential (
107+ { issuer, vc : generateCredential ( ) } ) ;
108+ const proof = proofExists ( securedCredentialNoPointers ) ;
109+ const decodedProof =
110+ await inspectSdProofValue ( proof ) ;
111+ should . exist ( decodedProof . mandatoryPointers ,
112+ 'Expected mandatoryPointers to be included in the proofValue.' ) ;
103113 } ) ;
104114 it ( 'Whenever this algorithm encodes strings, it MUST use UTF-8 encoding.' ,
105115 async function ( ) {
@@ -112,7 +122,11 @@ describe('Algorithms - Base Proof Transformation (ecdsa-sd-2023)', function() {
112122 'or 32 bytes.' ,
113123 async function ( ) {
114124 this . test . link = 'https://www.w3.org/TR/vc-di-ecdsa/#transformation-ecdsa-sd-2023' ;
115- this . skip ( ) ;
125+ const proof = proofExists ( securedCredential ) ;
126+ const decodedProof = await inspectSdProofValue ( proof ) ;
127+ decodedProof . hmacKey . length . should . equal ( 32 ,
128+ 'Expected HMAC key to be the same length as the digest size.'
129+ ) ;
116130 } ) ;
117131 } ) ;
118132 }
@@ -126,8 +140,9 @@ describe('Algorithms - Base Proof Configuration (ecdsa-sd-2023)', function() {
126140 const [ issuer ] = endpoints ;
127141 let securedCredential ;
128142 before ( async function ( ) {
143+ const mandatoryPointers = [ '/credentialSubject/name' ] ;
129144 securedCredential = await secureCredential (
130- { issuer, vc : generateCredential ( ) } ) ;
145+ { issuer, vc : generateCredential ( ) , mandatoryPointers } ) ;
131146 } ) ;
132147 it ( 'The proof options MUST contain a type identifier for the ' +
133148 'cryptographic suite (type) and MUST contain a cryptosuite ' +
@@ -174,8 +189,9 @@ describe('Algorithms - Base Proof Serialization (ecdsa-sd-2023)', function() {
174189 const [ issuer ] = endpoints ;
175190 let securedCredential ;
176191 before ( async function ( ) {
192+ const mandatoryPointers = [ '/credentialSubject/name' ] ;
177193 securedCredential = await secureCredential (
178- { issuer, vc : generateCredential ( ) } ) ;
194+ { issuer, vc : generateCredential ( ) , mandatoryPointers } ) ;
179195 } ) ;
180196 beforeEach ( setupRow ) ;
181197 it ( 'The proof options MUST contain a type identifier for the ' +
0 commit comments