# Attestations (NOM-151 and ICP-Brasil)

Some countries give extra legal weight to signed documents that a third party has attested at a
point in time. Set the envelope's `attestation` to have Sign API do this when it generates the
deliverable:

| `attestation` | Country | What is added |
|---|---|---|
| `none` (default) | | Nothing |
| `mx_nom151` | Mexico | A NOM-151 certificate of preservation (*constancia de conservación*) for the deliverable, from an accredited provider |
| `br_icp_brasil` | Brazil | A document time-stamp from an ICP-Brasil accredited time-stamping authority |

```json
{
  "title": "Contrato de servicios",
  "attestation": "mx_nom151",
  "language": "es",
  "documents": [ … ],
  "recipients": [ … ]
}
```

Each type is enabled per account. An envelope with a type your account hasn't enabled is refused
with [`attestation_not_enabled`](https://docs.signapi.dev/errors/attestation_not_enabled); ask support to turn it on.
Attestations can't be combined with [qualified signers](https://docs.signapi.dev/qualified-signatures).

## NOM-151 (`mx_nom151`)

The deliverable gets one more page, after the audit log and in Spanish, that names the envelope
and the deliverable and links to the deliverable's constancia, also as a QR code. After the
deliverable is sealed, only its SHA-256 hash goes to the NOM-151 provider; the document itself
never leaves the region. The provider's answer is checked against the file and kept with it.

- The constancia is an RFC 3161 time-stamp response (`.asn1`) whose imprint is the deliverable's
  hash. Keep it with the PDF: together they prove the file existed unchanged at that time.
- It is attached to the completion email, and the link on the page downloads it for as long as
  the envelope exists. The link holds no personal data.

## ICP-Brasil (`br_icp_brasil`)

After the deliverable is sealed, Sign API adds a document time-stamp from an ICP-Brasil accredited
authority as a new revision of the PDF, then the authority's certificate chain and revocation data
so the time-stamp can be validated later. Nothing visible changes and nothing is attached. PDF
readers list the time-stamp as a second signature after Sign API's seal.

A deliverable with a password can't take the extra revision; it is sealed without the time-stamp.

## Test mode

Test envelopes never call a provider. A sandbox authority answers instead, with the same structure
and no legal value, and the NOM-151 page says it is a test. Use test mode to check your
integration end to end before you go live.

## Checking a deliverable

Open the PDF in a reader that shows signatures, or drop it into the inspector on
[Verify a deliverable](https://docs.signapi.dev/verify): it lists Sign API's seal and, for ICP-Brasil, the document
time-stamp with its time and authority.
