# 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

```ts
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

- `jws` (string)
- `issuers` (Ap2UserMandateOptions["issuers"])
- `now` (number, optional)

## 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 }`

Runs locally, with no request to the API.
