verifyJWS(_:as:jsonDecoder:policy:)

Verify a JWS with x5c claims against the trusted root certificates, overriding the default JSON decoder.

X5CVerifier.swift:140
func verifyJWS<Payload>(_ token: some DataProtocol, as _: Payload.Type = Payload.self, jsonDecoder: any JWTJSONDecoder, @PolicyBuilder policy: () throws -> some VerifierPolicy = { RFC5280Policy(validationTime: Date()) }) async throws -> Payload where Payload : JWTPayload

Parameters

token

The JWS to verify.

payload

The type to decode from the token payload.

jsonDecoder

The JSON decoder to use for dcoding the token.

policy

The policy to use for verification.

Returns

The decoded payload, if verified.