Skip to content

verifyCompactJws ​

verifyCompactJws ​

Verifies a compact JWS.

The caller's algorithms list decides what is accepted; the token's alg only selects among them, and none is always refused as unsigned_token. The tokenType policy is applied before any key is resolved. A fixed key or the resolver's key must be an RSASSA-PKCS1-v1_5 SHA-256 public key of at least 2048 bits for RS256. Header members such as jku, jwk, x5u and x5c are never used to find a key. A resolver that throws or returns something other than a result is reported as key_resolution_failed without its message.

Returns a VerifiedJws on success. Failures carry a stable code and never echo the token.

ts
function verifyCompactJws(
	token: string,
	options: VerifyJwsOptions,
): Promise<JoseResult<VerifiedJws, VerifyJwsErrorCode>>

Parameters

Released under the MIT License.