Skip to content
Vapor Week is coming 14th September!

Instance Method

verifyJWS(_:as:)

Verify a JWS with the x5c header parameter against the trusted root certificates.
func verifyJWS<Payload>(_ token: String, as payload: Payload.Type = Payload.self) throws -> Payload where Payload : JWTPayload

Parameters

token

The JWS to verify.

payload

The type to decode from the token payload.

Return Value

The decoded payload, if verified.