# Validación de firmas

ZapSign ofrece un endpoint que valida si un archivo PDF fue firmado correctamente y se mantiene íntegro, asegurando conformidad con los estándares de seguridad y validez jurídica.

Este endpoint permite validar la integridad de firmas digitales en un archivo PDF. La validación confirma si:

* El PDF contiene una o más firmas digitales;
* Todas las firmas fueron emitidas por ZapSign;
* Las firmas son criptográficamente válidas;
* El documento no fue alterado después de la firma;
* No hay firmas pendientes o rechazadas.

{% hint style="warning" %}
En caso de documento inválido, el endpoint devuelve un mensaje con la razón por la cual fue invalidado.
{% endhint %}

***

### Cómo usar

<mark style="color:yellow;">`POST`</mark>`https://api.zapsign.com.br/api/v1/validate-pdf-signature/`

Envíe una solicitud con el método POST en formato `multipart/form-data` conteniendo el archivo PDF en el campo `file`.

**Headers**

| Clave        | Valor               |
| ------------ | ------------------- |
| Content-Type | multipart/form-data |

**Request Body (form-data)**

| Clave | Tipo          | Descripción                |
| ----- | ------------- | -------------------------- |
| file  | archivo (PDF) | Archivo PDF a ser validado |

<figure><img src="/files/0CxRdKdwRXG46YYMfw1r" alt=""><figcaption><p>Llamando al endpoint vía Postman</p></figcaption></figure>

### Ejemplo de respuesta

{% tabs %}
{% tab title="200-Documento válido" %}

```
{
    "isValid": true,
    "message": "Document signed correctly (CN=ZAPSIGN) and without subsequent notes.",
    "authority": "AC Certisign Multipla G7",
    "signingDate": "11/19/2024 14:34:58",
    "commonName": "ZAPSIGN PROCESSAMENTO DE DADOS LTDA"
}
```

{% endtab %}

{% tab title="200- Documento inválido" %}

```
{
    "isValid": false,
    "message": "Signature Signature1 does not cover the whole document",
    "authority": "N/A",
    "signingDate": "N/A",
    "commonName": "N/A"
}
```

{% endtab %}

{% tab title="400-error" %}
{\
"error": "Nenhum arquivo foi enviado."\
}
{% endtab %}
{% endtabs %}

### Posibles mensajes en caso de documento inválido

| Mensaje                                                                                        | Descripción                                                                             |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `Signature signature1 does not cover the whole document`                                       | La firma no cubre todo el documento                                                     |
| `Certificate validation failed: CN is not ZAPSIGN PROCESSAMENTO DE DADOS LTDA`                 | El documento contiene una o más firmas que no fueron realizadas por ZapSign             |
| `Signature signature1 not valid because the document contains pending signature indicators`    | El documento es inválido porque contiene indicadores de firmas pendientes               |
| `Signature signature1 is not valid because the document contains refused signature indicators` | El documento es inválido porque contiene indicadores de firmas rechazadas               |
| `Document does not contain digital signatures`                                                 | El documento no está firmado                                                            |
| `Signature signature1 is not cryptographically valid`                                          | El documento contiene una firma inválida o fue modificado después de haber sido firmado |

***

### ¡Habla con Gepeto!

¿Tienes alguna duda? Utiliza nuestra inteligencia artificial entrenada con toda la documentación de la API.

{% embed url="<https://n8n.zapsign.com.br/webhook/fee2c476-7f23-4a4f-8928-5c7ab081ffcd/chat>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zapsign.com.br/espanol/validacion-de-firmas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
