SDK reference · Rails
verifyAp2AppKeyAttestation
verifyAp2AppKeyAttestation in @provenanceauth/rails/ap2, Rails. Verify an app-key attestation (com.provenanceauth.app_key) against the listed issuers: ES256, typ ap2-app-key+jwt, a key of a listed issuer, unexpired, with a P-256 jwk.
Signature
verifyAp2AppKeyAttestation(jws: string, issuers: Ap2UserMandateOptions["issuers"], now?: number): | { ok: true; issuer: string; jwk: Record<string, unknown>; sub: string | null; approval_id: string | null; exp: number | null } | { ok: false; reason: "issuer_not_trusted" | "signature_invalid" | "expired"; detail: string }Parameters
jwsstringRequiredissuersAp2UserMandateOptions["issuers"]Requirednownumber
Returns
| { ok: true; issuer: string; jwk: Record<string, unknown>; sub: string | null; approval_id: string | null; exp: number | null } | { ok: false; reason: "issuer_not_trusted" | "signature_invalid" | "expired"; detail: string }
HTTP operation
Runs locally, with no request to the API.