/
opt
/
canhelp
/
node_modules
/
jose
/
dist
/
webapi
/
jws
/
general
/
/opt/canhelp/node_modules/jose/dist/webapi/jws/general
mkdir
upload
Name
Size
Mode
Actions
sign.js
2236
0644
edit
dl
rm
verify.js
904
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/jose/dist/webapi/jws/general/verify.js
(904B)
import { flattenedVerify } from '../flattened/verify.js'; import { JWSInvalid, JWSSignatureVerificationFailed } from '../../util/errors.js'; import { isObject } from '../../lib/type_checks.js'; export async function generalVerify(jws, key, options) { if (!isObject(jws)) { throw new JWSInvalid('General JWS must be an object'); } if (!Array.isArray(jws.signatures) || !jws.signatures.every(isObject)) { throw new JWSInvalid('JWS Signatures missing or incorrect type'); } for (const signature of jws.signatures) { try { return await flattenedVerify({ header: signature.header, payload: jws.payload, protected: signature.protected, signature: signature.signature, }, key, options); } catch { } } throw new JWSSignatureVerificationFailed(); }
Save
cmd:
run