---
title: "Carimbar um PDF com data e hora"
product: "PKI Suite"
slug: "timestamp-a-pdf"
language: "pt"
canonical_url: "https://try.lacunasoftware.com/pt/pki-suite/timestamp-a-pdf"
docs_url: "https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core"
samples: []
samples_repo: "https://github.com/LacunaSoftware/PkiSuiteSamples"
trace_recorded: "2026-10-12"
last_generated: "2026-10-12T15:24:28Z"
---

# Carimbar um PDF com data e hora

Solte um PDF ou use o exemplo: o Rest PKI Core, o serviço em nuvem da Lacuna, adiciona um carimbo do tempo que comprova que o PDF existia como está naquele momento, e você o baixa.

Live demo: [https://try.lacunasoftware.com/pt/pki-suite/timestamp-a-pdf](https://try.lacunasoftware.com/pt/pki-suite/timestamp-a-pdf). It runs against Lacuna's real products; this page describes it for AI coding agents.

## Call sequence

Recorded on 2026-10-12 against the real products with Lacuna's public test certificates and data. Keys, tokens, sessions, ids, file contents and personal data are masked.

### 1. Rest PKI Core adds a document timestamp from the PkiBrazil tier over the whole PDF, and the stamped PDF is downloaded from the temporary link it returns.

On the server: `IRestPkiService.StampPdfAsync, then IRestPkiService.OpenReadAsync`

`POST https://core.pki.rest/api/pdf/stamp` → 200

Request:

```json
{
  "File": {
    "MimeType": "application/pdf",
    "Content": "<Content, 1609 bytes>",
    "Name": "document.pdf",
    "Length": 0,
    "ContentType": "application/pdf"
  },
  "TimestampTier": "PkiBrazil",
  "ForceBlobResult": true
}
```

Response:

```json
{
  "file": {
    "mimeType": "application/pdf",
    "blobToken": "***",
    "url": "https://restpkicore.lacunasoftware.com/api/blobs?token={value}",
    "length": 21365,
    "contentType": "application/pdf",
    "location": "https://restpkicore.lacunasoftware.com/api/blobs?token={value}"
  }
}
```

`GET https://restpkicore.lacunasoftware.com/api/blobs?token={value}` → 200

Response:

```json
"<application/pdf, 21365 bytes>"
```

### 2. PKI SDK opens the stamped PDF and reads the new timestamp back, the last of its signers marked as a timestamp, for the result.

On the server, in process: `PadesSignature.Open(pdf)`

## Patterns to copy

- Always name a timestamp tier on the stamp call (the Demo uses `PkiBrazil`): a stamp takes no security context.
- Set `ForceBlobResult = true`, or Rest PKI Core returns the file inline in a reference the client can't read; then download it with `OpenReadAsync(File.Url)`. Never log that link, which carries an access ticket.
- Each stamp is billed: if only the download fails, the PDF was already stamped.
- Read the new timestamp back by opening the stamped PDF with PKI SDK: document timestamps are among the PAdES signers with `IsTsp` set, the newest last.

## Links

- Live demo: https://try.lacunasoftware.com/en/pki-suite/timestamp-a-pdf (Portuguese: https://try.lacunasoftware.com/pt/pki-suite/timestamp-a-pdf)
- Docs: https://docs.lacunasoftware.com/pt-br/articles/rest-pki/core
- Samples: https://github.com/LacunaSoftware/PkiSuiteSamples
- Every demo: https://try.lacunasoftware.com/llms.txt and https://try.lacunasoftware.com/demos.json
