# SignaturesApi

The Signatures panel, headless. **Metadata only**: the SDK does not validate a signature cryptographically — present what it reports as "the document declares a signature", never as "the signature is valid". The panel is described under [Document features](https://kernstra.com/docs/web-sdk/guides/document-features).

A certification signature says what may change after it (`SignatureInfo.changesAllowed`, the certification level): `'none'`, `'forms'` (filling and signing) or `'annotations'` (those and comments). The SDK enforces it as Acrobat does: in the document API, a write the level forbids rejects with `INVALID_STATE` unless the call passes `invalidateSignatures: true`, and `doc.forms.setValues()` rejects every field as `read_only` at `'none'`. A signed document with no certification (an approval signature) is not restricted. A signed document is always saved as one incremental update on the bytes it was signed over, so a change the certification allows reads in Acrobat as made after signing, not as a broken signature; see [`doc.save()`](https://kernstra.com/docs/web-sdk/api/pdfdocument/save).

- Kind: namespace
- Access: `doc.signatures`

## Usage

```ts
const signatures = await doc.signatures.list();
const certified = signatures.find((s) => s.signed && s.changesAllowed !== null);
if (certified) console.log('Certified: changes allowed =', certified.changesAllowed);
```

## Reading

### `list`

```ts
list(): Promise<SignatureInfo[]>
```

Every signature's metadata — reason, signing time, sub-filter, certification level (`changesAllowed`), whether it is signed (`signed`). Says whether a document is signed and what its certification allows. A signature field nested under a parent field (a dotted name) counts too, though the document's own list of signature fields does not include it. Without the `extract` feature each `reason` is `''`. Needs no feature.

- Kind: method
- Since: 1.0.0

Returns `Promise<SignatureInfo[]>`: Each `{ index, reason, signedAt, subFilter, changesAllowed, signed }`: `reason` (`''` when absent), `signedAt` (when it was signed, as the signature says; `null` when it does not), `subFilter` (the signature's format as the file names it, `'adbe.pkcs7.detached'` …, or `''`), `changesAllowed` (`'none' | 'forms' | 'annotations'`: what the signer allowed afterwards; `null` when unsaid) and `signed` (whether it holds signature bytes, or is a field still to be signed).

Throws:

- `DOCUMENT_CLOSED` — the document has been closed.

```ts
const signed = (await doc.signatures.list()).some((s) => s.signed);
if (signed) showNotice('Changes are saved after the signed version');
```

Page: https://kernstra.com/docs/web-sdk/api/doc-signatures/list

Web page: https://kernstra.com/docs/web-sdk/api/doc-signatures
