jose.jws.verify

jose.jws

verify(compact, keys, opts) -> payload, header

Verify a compact serialization and return its payload

keys is one key or a key set. The checks run in this order: the size cap, three segments, strict base64url, a header object with a string alg, an alg this module carries (none is not one), crit and b64 absent, alg in opts.algs when given, the key selected by kid, alg equal to the key's own, the signature's length, and at last the signature itself. An HS256 tag is compared in constant time. Header jwk, x5c and typ are returned and never acted on. On success the second value is the decoded header.