File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import { compareVersions } from 'compare-versions' ;
22import { X509Certificate } from '@peculiar/x509' ;
3- import { importX509 , JWK , KeyLike } from 'jose' ;
3+ import { importJWK , importX509 , JWK , KeyLike } from 'jose' ;
44import { Buffer } from 'buffer' ;
5- import { COSEKeyToJWK , Sign1 , importCOSEKey } from 'cose-kit' ;
5+ import { COSEKeyToJWK , Sign1 } from 'cose-kit' ;
66import crypto from 'uncrypto' ;
77import { MDoc } from './model/MDoc' ;
88
@@ -157,7 +157,9 @@ export class Verifier {
157157 }
158158
159159 if ( deviceAuth . deviceSignature ) {
160- const deviceKey = await importCOSEKey ( deviceKeyCoseKey ) ;
160+ const deviceKeyJwk = COSEKeyToJWK ( deviceKeyCoseKey ) ;
161+ // When deviceKey (COSE Key) does not contain the `alg` parameter, use the one specified by the COSE_Sign1
162+ const deviceKey = await importJWK ( deviceKeyJwk , deviceKeyJwk . alg ?? deviceAuth . deviceSignature . algName ) ;
161163
162164 // ECDSA/EdDSA authentication
163165 try {
You can’t perform that action at this time.
0 commit comments