File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
apps/oid4vc-issuance/libs/helpers Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,16 @@ function buildSdJwtCredential(
279279 // // strip vct if present per requirement
280280 // delete payloadCopy.vct;
281281
282- if ( signerOptions [ 0 ] . method === SignerMethodOption . X5C && credentialRequest . validityInfo ) {
283- const certificateDetail = activeCertificateDetails . find ( ( x ) => x . certificateBase64 === signerOptions [ 0 ] . x5c [ 0 ] ) ;
282+ let templateSignerOption : SignerOption ;
283+ if ( templateRecord . signerOption . toLowerCase ( ) === SignerMethodOption . X5C ) {
284+ templateSignerOption = signerOptions . find ( ( x ) => SignerMethodOption . X5C === x . method ) ;
285+ } else if ( templateRecord . signerOption . toLowerCase ( ) === SignerMethodOption . DID ) {
286+ templateSignerOption = signerOptions . find ( ( x ) => SignerMethodOption . DID === x . method ) ;
287+ }
288+
289+ if ( templateRecord . signerOption === SignerMethodOption . X5C && credentialRequest . validityInfo ) {
290+ const certificateDetail = activeCertificateDetails . find ( ( x ) => x . certificateBase64 === templateSignerOption . x5c [ 0 ] ) ;
291+
284292 const validationResult = validateCredentialDatesInCertificateWindow (
285293 credentialRequest . validityInfo ,
286294 certificateDetail
@@ -319,7 +327,7 @@ function buildSdJwtCredential(
319327
320328 return {
321329 credentialSupportedId,
322- signerOptions : signerOptions ? signerOptions [ 0 ] : undefined ,
330+ signerOptions : templateSignerOption ? templateSignerOption : undefined ,
323331 format : apiFormat ,
324332 payload : payloadCopy ,
325333 ...( disclosureFrame ? { disclosureFrame } : { } )
You can’t perform that action at this time.
0 commit comments