File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import jose , { JWK } from 'node-jose' ;
1+ import { JWK , JWS } from 'node-jose' ;
22import pako from 'pako' ;
33import base64url from 'base64url' ;
44import { resolveKey , addCachedKeys } from './resolver' ;
@@ -34,7 +34,7 @@ export async function sign(payload, privateKey) {
3434 const fields = { zip : 'DEF' } ;
3535 const body = pako . deflateRaw ( bodyString ) ;
3636
37- const signed = await jose . JWS . createSign ( { format : 'compact' , fields } , signingKey )
37+ const signed = await JWS . createSign ( { format : 'compact' , fields } , signingKey )
3838 . update ( Buffer . from ( body ) )
3939 . final ( ) ;
4040
@@ -67,7 +67,7 @@ async function verifyAndReturnPayload(jws, publicKeyArray) {
6767
6868 let issuer = await getVerificationKeyForJws ( jws ) ;
6969
70- const verified = await jose . JWS . createVerify ( await JWK . asKey ( issuer . didDocument ) ) . verify ( jws )
70+ const verified = await JWS . createVerify ( await JWK . asKey ( issuer . didDocument ) ) . verify ( jws )
7171
7272 let body = verified . payload ;
7373 if ( ( verified . header ) . zip === 'DEF' ) {
You can’t perform that action at this time.
0 commit comments