> ## Documentation Index
> Fetch the complete documentation index at: https://docs.use.observer/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify a signed document

> Check that an SLA statement, customer notice, incident evidence export or evidence pack is unchanged and was issued by Observer, from its PDF or JSON.

Observer signs the documents you give to customers, auditors and
regulators. Anyone holding one can check it at
[use.observer/reliability/verify](https://use.observer/reliability/verify),
without an Observer account.

## Signed documents

| Document | Where it comes from |
| - | - |
| [SLA statement](https://docs.use.observer/docs/concepts/sla-methodology.md#verifying-a-statement) | SLA Ledger, and the customer's [Reliability Center](https://docs.use.observer/docs/guides/reliability-portal.md) portal |
| [Customer notice](https://docs.use.observer/docs/guides/customer-notices.md#signed-pdf) | **Download PDF** on a notice |
| [Incident evidence export](https://docs.use.observer/docs/guides/incident-evidence.md#signed-evidence-export) | The incident's **Evidence** panel, or `GET /incidents/{id}/evidence` |
| [Evidence pack](https://docs.use.observer/docs/guides/evidence-packs.md#verify-a-pack) | **Reports**, **Evidence packs** |

Each document is a JSON payload. Observer writes it with object keys
sorted and no spaces, computes its SHA-256, and signs that digest with
Ed25519. The JSON download is an envelope that holds the payload, its
digest and the signature:

```json theme={null}
{
  "payload": { "...": "..." },
  "sha256": "...",
  "signature": "...",
  "signing_key_id": "...",
  "signature_alg": "...",
  "verify_url": "https://use.observer/reliability/verify?sha256=..."
}
```

Only `payload` is signed. Fields beside it, such as a statement's
`revision` and `state`, are not.

Every PDF prints the SHA-256, the signature and the signing key in its
**Verification** section, and carries the same JSON envelope as an
attachment.

## Check a document

1. Open [use.observer/reliability/verify](https://use.observer/reliability/verify).
2. Choose the document's PDF or its JSON download, or paste the JSON.
3. The page recomputes the SHA-256 of the payload and checks the
   signature against Observer's published keys. A signature by a revoked
   key fails.

The page reads a PDF in your browser and sends only the attached JSON to
be checked. Nothing is stored.

With a PDF, the check covers the data attached to it, not its printed
pages: someone could edit the pages and leave the attachment as it was.
When the check passes, the page lists what Observer signed so you can
compare:

* the kind of document, the organisation, the customer and the subject;
* the period, or a notice's or evidence export's time window;
* the issue date and the revision;
* a statement's credit, and the number of incidents in a statement or
  evidence pack, and of exclusion windows in a pack;
* for statements and evidence packs, each SLO's measured and target
  figures;
* the status page a notice was issued for.

If the printed pages show anything different, the copy was changed after
Observer signed it. Nothing is listed when the check fails.

Organisation and customer names are the names the issuing account set in
Observer. Observer does not check them against any register.

### The SHA-256 and signature on their own

The **sha256 and signature** tab takes the values printed on a document.
A pass shows only that Observer signed that digest. It does not show
which figures the digest covers: anyone can print a genuine digest and
signature next to edited figures. To check the figures, choose the PDF or
the JSON.

The verify link in a document's JSON download (`verify_url`, with
`?sha256=`) opens the document tab and names the document it is for. If
you then choose a different document, the page says so. The **sha256 and
signature** tab is filled in with that SHA-256.

### When a PDF cannot be read

The check needs the attachment Observer put in the PDF. A PDF that was
printed to a new PDF, scanned or re-saved by some editors loses the
attachment, or stores it in a form the page cannot read. The page then
asks for the JSON. Ask the sender for the original PDF or for the JSON
download.

## Verify without Observer

The public keys are published at
[use.observer/.well-known/observer-signing-keys](https://use.observer/.well-known/observer-signing-keys),
including retired ones, so documents signed before a key change still
verify. A key that must no longer be trusted is marked `revoked: true`.

1. Get the JSON envelope: the JSON download, or the PDF's attachment
   (any PDF reader can save it, or `pdfdetach -saveall document.pdf`
   from poppler).
2. Write `payload` as JSON with object keys sorted, arrays in their
   original order and no whitespace, encoded as UTF-8.
3. Compute its SHA-256 and compare it with `sha256`.
4. Find the key whose `key_id` equals `signing_key_id`, and verify
   `signature` (base64) as an Ed25519 signature over the 32 bytes of the
   digest, not over its hex text.
5. Reject the document if the key is marked `revoked: true`.

In Node.js:

```js theme={null}
// node verify.mjs document.json
import crypto from "node:crypto";
import { readFileSync } from "node:fs";

const sorted = (v) =>
  Array.isArray(v) ? v.map(sorted)
  : v && typeof v === "object"
    ? Object.fromEntries(Object.keys(v).sort().map((k) => [k, sorted(v[k])]))
    : v;

const doc = JSON.parse(readFileSync(process.argv[2], "utf8"));
const digest = crypto.createHash("sha256").update(JSON.stringify(sorted(doc.payload))).digest();
console.log("sha256 matches:", digest.toString("hex") === doc.sha256);

const res = await fetch("https://use.observer/.well-known/observer-signing-keys");
const { keys } = await res.json();
const key = keys.find((k) => k.key_id === doc.signing_key_id);
const valid =
  !!key && !key.revoked &&
  crypto.verify(null, digest, crypto.createPublicKey(key.public_key_pem), Buffer.from(doc.signature, "base64"));
console.log("signature valid:", valid);
```

## Unsigned copies

* Evidence packs generated before packs were signed are signed the next
  time they are downloaded. Download the pack again to get a signed copy.
* A pack copy downloaded before then stays unsigned, and so do SLA reports
  issued before statements were signed. An unsigned document's SHA-256
  identifies the data, but anyone who edits the data can recompute a hash,
  so an unsigned copy does not show that it came from Observer.
* If Observer cannot sign a document when it is downloaded, it does not
  issue the document. The download fails, and the API returns `503`. Try
  again later.

## On your status page

When the [Reliability Center](https://docs.use.observer/docs/guides/reliability-portal.md) is turned
on, your status page has its own copy of the verify page at
`/reliability/verify`, in the page's theme and language. It follows the
page's access settings: on a page protected by a password, sign-in or an
IP allowlist, only visitors with access can open it.

Documents print the use.observer address, which works for anyone,
whatever your status page's settings or plan.

## What a signature shows

A valid signature shows that Observer issued this data, unchanged, from
the account named in it. It does not show that a system was up or that a
contract was met: the figures are Observer's measurements from that
account's configured checks. See
[SLA methodology](https://docs.use.observer/docs/concepts/sla-methodology.md) for how they are
calculated.

## Related

* [Evidence packs](https://docs.use.observer/docs/guides/evidence-packs.md)
* [Incident evidence](https://docs.use.observer/docs/guides/incident-evidence.md)
* [Customer notices](https://docs.use.observer/docs/guides/customer-notices.md)
* [SLA methodology](https://docs.use.observer/docs/concepts/sla-methodology.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.