File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ import {
1212 encodeBs64Url ,
1313 getBs64UrlBytes
1414} from '../helpers.js' ;
15+ import {
16+ parseDisclosureProofValue ,
17+ serializeProofValue
18+ } from './stubs.js' ;
1519import { expect } from 'chai' ;
1620import { getMultiKey } from '../vc-generator/key-gen.js' ;
1721import { getSuites } from './helpers.js' ;
@@ -355,5 +359,10 @@ async function _setup({
355359 invalidProofValueHeader . proof . proofValue = `u${ encodeBs64Url ( invalidBuffer ) } ` ;
356360 credentials . set ( 'invalidDisclosureProofHeader' , invalidProofValueHeader ) ;
357361 const invalidProofArray = structuredClone ( securedCredential ) ;
362+ const params = parseDisclosureProofValue ( { proof : invalidProofArray . proof } ) ;
363+ invalidProofArray . proof . proofValue = serializeProofValue ( {
364+ payload : [ params . baseSignature , params . publicKey ]
365+ } ) ;
366+ credentials . set ( 'invalidProofArray' , invalidProofArray ) ;
358367 return credentials ;
359368}
Original file line number Diff line number Diff line change @@ -101,6 +101,18 @@ function serializeDisclosureProofValue({
101101 return `u${ base64url . encode ( cbor ) } ` ;
102102}
103103
104+ // ecdsa-sd-2023 test data creation function
105+ export function serializeProofValue ( {
106+ prefix = CBOR_PREFIX_DERIVED ,
107+ payload,
108+ typeEncoders
109+ } ) {
110+ const cbor = _concatBuffers ( [
111+ prefix , cborg . encode ( payload , { useMaps : true , typeEncoders} )
112+ ] ) ;
113+ return `u${ base64url . encode ( cbor ) } ` ;
114+ }
115+
104116// ecdsa-sd-2023 derive helper
105117async function _createDisclosureData ( {
106118 cryptosuite, document, proof, documentLoader
You can’t perform that action at this time.
0 commit comments