---
title: "Firmar por lotes (Certificado en la nube, con CloudHub)"
product: "PKI Suite"
slug: "sign-a-batch-with-cloud-certificate"
language: "es"
canonical_url: "https://try.lacunasoftware.com/es/pki-suite/sign-a-batch-with-cloud-certificate"
docs_url: "https://docs.lacunasoftware.com/en-us/articles/cloudhub/pades-signature"
samples:
  - title: "Sign a PDF with a cloud certificate using CloudHub"
    language: "dotnet"
    framework: "aspnet-mvc"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PadesCloudHubSdkController.cs"
  - title: "Sign a PDF with a cloud certificate (OAuth flow) using PKI SDK"
    language: "dotnet"
    framework: "aspnet-mvc"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PadesCloudOauthSdkController.cs"
  - title: "Sign a PDF with a cloud certificate (password flow) using PKI SDK"
    language: "dotnet"
    framework: "aspnet-mvc"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PadesCloudPwdSdkController.cs"
  - title: "Sign a PDF with a cloud certificate using CloudHub"
    language: "java"
    framework: "spring-boot"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/PadesSignatureCloudhubRestController.java"
  - title: "Sign a PDF with a cloud certificate using CloudHub"
    language: "nodejs"
    framework: "express"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/nodejs/expressmvc/routes/pades-signature-cloudhub-restpki.js"
  - title: "Sign a PDF with a cloud certificate using CloudHub"
    language: "php"
    framework: "php"
    url: "https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/php/plain/public/pades-signature-cloudhub-rest/index.php"
samples_repo: "https://github.com/LacunaSoftware/PkiSuiteSamples"
trace_recorded: null
last_generated: "2026-11-10T22:45:25Z"
---

# Firmar por lotes (Certificado en la nube, con CloudHub)

Firme varios PDF con una sola autorización en su PSC: CloudHub, en el servidor, llega a su PSC, que firma el hash de cada PDF en una sola sesión de firma, y PKI SDK, en el servidor, construye cada firma.

Live demo: [https://try.lacunasoftware.com/es/pki-suite/sign-a-batch-with-cloud-certificate](https://try.lacunasoftware.com/es/pki-suite/sign-a-batch-with-cloud-certificate). It runs against Lacuna's real products; this page describes it for AI coding agents.

## Call sequence

No call sequence is recorded for this demo, so none is shown here: this page doesn't guess calls. There is no CloudHub sandbox to record against, and authorizing the signatures at the PSC needs the certificate's holder. The docs and samples below show the calls; the live demo makes them.

## Patterns to copy

- Sign a batch in one Signature session: look the CPF up once, send the user to their PSC once, and sign every PDF in the session CloudHub hands back. CloudHub has no batch call, so each PDF goes through the same Start, CloudHub sign-hash and Complete as a single file, one PDF at a time, and only each PDF's hash leaves your server.
- Read the certificate once, in the session, before the first Start, and prepare every PDF with it; Start validates it, so a certificate that can't sign is refused before the PSC is asked to sign anything.
- The PSC decides when the session ends, 15 minutes by default: if it ends mid-batch (`SessionExpired` or `SessionInvalidOrAlreadyUsed` on the exception's `CodeStr`), fail the PDFs not signed yet with that code, keep the signed ones, and look the CPF up again for the rest. A PDF that fails for any other reason fails alone.
- Treat `session` as a bearer secret: keep it on the server, never log it, and strip it from the return page's address bar. Several pages can share one return page by naming themselves in the redirect URI, checked against an allow-list, so the return page's Start over leads back to the right one.
- Count the Batch against your per-IP limit for all its PDFs before the first Start, so it is never refused halfway.

## Links

- Live demo: https://try.lacunasoftware.com/en/pki-suite/sign-a-batch-with-cloud-certificate (Portuguese: https://try.lacunasoftware.com/pt/pki-suite/sign-a-batch-with-cloud-certificate; Spanish: https://try.lacunasoftware.com/es/pki-suite/sign-a-batch-with-cloud-certificate)
- Docs: https://docs.lacunasoftware.com/en-us/articles/cloudhub/pades-signature
- Sample, .NET (aspnet-mvc): [Sign a PDF with a cloud certificate using CloudHub](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PadesCloudHubSdkController.cs)
- Sample, .NET (aspnet-mvc): [Sign a PDF with a cloud certificate (OAuth flow) using PKI SDK](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PadesCloudOauthSdkController.cs)
- Sample, .NET (aspnet-mvc): [Sign a PDF with a cloud certificate (password flow) using PKI SDK](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/dotnet/mvc/PkiSuiteAspNetMvcSample/Controllers/PadesCloudPwdSdkController.cs)
- Sample, Java (spring-boot): [Sign a PDF with a cloud certificate using CloudHub](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/java/springmvc/src/main/java/com/lacunasoftware/pkisuite/controller/PadesSignatureCloudhubRestController.java)
- Sample, Node.js (express): [Sign a PDF with a cloud certificate using CloudHub](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/nodejs/expressmvc/routes/pades-signature-cloudhub-restpki.js)
- Sample, PHP (php): [Sign a PDF with a cloud certificate using CloudHub](https://github.com/LacunaSoftware/PkiSuiteSamples/blob/master/php/plain/public/pades-signature-cloudhub-rest/index.php)
- Every demo: https://try.lacunasoftware.com/llms.txt and https://try.lacunasoftware.com/demos.json
