---
title: "Añadir un sello de tiempo"
product: "PKI Suite"
slug: "timestamp-a-pdf"
language: "es"
canonical_url: "https://try.lacunasoftware.com/es/pki-suite/timestamp-a-pdf"
docs_url: "https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/requesting-timestamps"
samples:
  - title: "Timestamp a PDF with Rest PKI Core"
    language: "dotnet"
    framework: "aspnet-core-angular"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/spa/PkiSuiteAspNetCoreAngularSample/PkiSuiteAspNetCoreAngularSample.Server/Controllers/TimestampPdfRestPkiCoreController.cs"
  - title: "Timestamp a PDF with Rest PKI Core"
    language: "dotnet"
    framework: "aspnet-mvc"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/TimestampPdfRestCoreController.cs"
  - title: "Timestamp a PDF with Rest PKI Core"
    language: "nodejs"
    framework: "express"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/nodejs/expressmvc/routes/timestamp-pdf-core.js"
  - title: "Timestamp a PDF with Rest PKI Core"
    language: "php"
    framework: "php"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/php/plain/public/timestamp-pdf-rest-core/index.php"
  - title: "Timestamp a PDF with Rest PKI Core"
    language: "python"
    framework: "flask"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/python/flask/sample/views/timestamp_pdf_rest_core.py"
  - title: "Timestamp a PDF with Rest PKI Core"
    language: "ruby"
    framework: "rails"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/ruby/rails/app/controllers/timestamp_pdf_rest_core_controller.rb"
samples_repo: "https://github.com/LacunaSoftware/PkiSuiteSamples"
trace_recorded: "2026-10-12"
last_generated: "2026-11-10T22:45:25Z"
---

# Añadir un sello de tiempo

Suelte un PDF o use el de ejemplo: Rest PKI Core, el servicio en la nube de Lacuna, le añade un sello de tiempo que demuestra que el PDF existía tal como está en ese momento, y usted lo descarga.

Live demo: [https://try.lacunasoftware.com/es/pki-suite/timestamp-a-pdf](https://try.lacunasoftware.com/es/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; Spanish: https://try.lacunasoftware.com/es/pki-suite/timestamp-a-pdf)
- Docs: https://docs.lacunasoftware.com/en-us/articles/rest-pki/core/requesting-timestamps
- Sample, .NET (aspnet-core-angular): [Timestamp a PDF with Rest PKI Core](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/spa/PkiSuiteAspNetCoreAngularSample/PkiSuiteAspNetCoreAngularSample.Server/Controllers/TimestampPdfRestPkiCoreController.cs)
- Sample, .NET (aspnet-mvc): [Timestamp a PDF with Rest PKI Core](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/TimestampPdfRestCoreController.cs)
- Sample, Node.js (express): [Timestamp a PDF with Rest PKI Core](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/nodejs/expressmvc/routes/timestamp-pdf-core.js)
- Sample, PHP (php): [Timestamp a PDF with Rest PKI Core](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/php/plain/public/timestamp-pdf-rest-core/index.php)
- Sample, Python (flask): [Timestamp a PDF with Rest PKI Core](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/python/flask/sample/views/timestamp_pdf_rest_core.py)
- Sample, Ruby (rails): [Timestamp a PDF with Rest PKI Core](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/ruby/rails/app/controllers/timestamp_pdf_rest_core_controller.rb)
- Every demo: https://try.lacunasoftware.com/llms.txt and https://try.lacunasoftware.com/demos.json
