File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- import jose , { JWK } from 'node-jose' ;
1
+ import { JWK , JWS } from 'node-jose' ;
2
2
import pako from 'pako' ;
3
3
import base64url from 'base64url' ;
4
4
import { resolveKey , addCachedKeys } from './resolver' ;
@@ -34,7 +34,7 @@ export async function sign(payload, privateKey) {
34
34
const fields = { zip : 'DEF' } ;
35
35
const body = pako . deflateRaw ( bodyString ) ;
36
36
37
- const signed = await jose . JWS . createSign ( { format : 'compact' , fields } , signingKey )
37
+ const signed = await JWS . createSign ( { format : 'compact' , fields } , signingKey )
38
38
. update ( Buffer . from ( body ) )
39
39
. final ( ) ;
40
40
@@ -67,7 +67,7 @@ async function verifyAndReturnPayload(jws, publicKeyArray) {
67
67
68
68
let issuer = await getVerificationKeyForJws ( jws ) ;
69
69
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 )
71
71
72
72
let body = verified . payload ;
73
73
if ( ( verified . header ) . zip === 'DEF' ) {
You can’t perform that action at this time.
0 commit comments