> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/publico-editranff-v6.2-windows-en/comandos/xades.md).

# XAdES

Command for automatic creation and verification of XAdES signatures. Usage:

![](https://content.gitbook.com/content/AKp9o4ESamTHpX42EKdv/blobs/Dcf3pfqyoLWt8rlSdhfQ/image1.png)

To use it, it is essential that the Java Editran Signature Services process for XAdES signatures is correctly configured and started in the installation; see **7.12.**

Please note:

* In usage mode 1), to prevent the automatic signing process from waiting for the certificate password to be entered, the secure private key protection must be disabled for it (this parameter is configured during certificate installation).
* In usage mode 1), if the specified file has its own signature extension (.*p7b* or .*xsig*), the file will be searched for in the application's signatures directory and the new signature will be added to it. Otherwise, the file will be searched for in the application's data directory and a new signature file will be created in the signatures directory.
* Usage mode 2) is valid only for applications whose purpose is to verify signatures.
* The input file for usage mode 3) must be a signature file located in the application's signatures directory.

The result code returned by the XAdES.exe command (accessible using echo %ERRORLEVEL% after execution) can be one of:

| **Result** | **Description**                                                                                                                                                                                                                                                                                                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **0**      | **OK**: correct signing or verification.                                                                                                                                                                                                                                                                                                                                                     |
| **1**      | **SYNTAX\_ERROR**: incorrect parameters; the application's usage mode must be consulted.                                                                                                                                                                                                                                                                                                     |
| **2**      | **FF\_PROFILE\_ERROR**: the applications or users indicated in the parameters are not found in the Editran/FF profiles.                                                                                                                                                                                                                                                                      |
| **3**      | **LICENSE\_ERROR**: license for the product is missing.                                                                                                                                                                                                                                                                                                                                      |
| **4**      | **ERROR\_NO\_SIGNATURES**: there is no communication with the server (the Java service has not been started, etc.); the signing or verification request could not be carried out.                                                                                                                                                                                                            |
| **5**      | **INCORRECT\_SIGNATURE\_ERROR**: the server returns an error because the file to be signed or verified has invalid, malformed signatures, or was created with an expired certificate, has been tampered with, etc. For more details, see \[Editran/FF installation path]\XAdES\logs\out.log and file \[file name to sign or verify].ctrl in \[Editran/FF Application data directory]\TMP.XD. |
| **6**      | **INCORRECT\_SIGNATURE\_ERROR\_PROFILES**: the signature to be performed or validated is not correct according to the profiles (required signatures, amount limit, etc.).                                                                                                                                                                                                                    |
| **7**      | **CANCELLED\_OPERATION\_ERROR**: only in usage mode 1), the certificate with which the file will be signed has secure protection mode enabled and Cancel was pressed in the window requesting the certificate password.                                                                                                                                                                      |
| **8**      | **FILE\_STANDARD\_ERROR**: when verifying the signature against profiles, the file amount must be taken into account, but it cannot be obtained because the file does not correspond to the standard associated with the application.                                                                                                                                                        |

In usage modes 2) and 3), a file \[Editran/FF Application data directory]\TMP.XD\\\[Verified file name].ctrl is created. The content of that file consists of a first line with the code returned by the service *Editran* *Signature Services* followed by its description. Then there are as many lines as there are certificates with which the file was signed. These lines start with S if the certificate is in the profiles, or with N otherwise. After S or N, the certificate DN will follow.

For example:

00

S CN=NAME 1…

N CN=NAME 2…

The result code of the *Editran Signature Services* service can be one of:

| **Result**                                                         | **Description**                                                                 |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| **00**                                                             | Correct result                                                                  |
| **01**                                                             | Warning: signing was performed with warnings. It has not been signed implicitly |
| **Reading the data needed for signing and signature verification** |                                                                                 |
| **17**                                                             | Request not built correctly                                                     |
| **18**                                                             | Error reading the frame length from the read buffer                             |
| **19**                                                             | Requesting function not recognized                                              |
| **20**                                                             | Signature type not recognized                                                   |
| **21**                                                             | Source machine language not recognized                                          |
| **22**                                                             | OCSP or CRL validation value not recognized                                     |
| **23**                                                             | Compression value not recognized                                                |
| **24**                                                             | Encryption value not recognized                                                 |
| **25**                                                             | Base64 conversion value not recognized                                          |
| **26**                                                             | Input file identifier not recognized                                            |
| **29**                                                             | No input file specified                                                         |
| **30**                                                             | No auxiliary file specified                                                     |
| **31**                                                             | No output file specified                                                        |
| **32**                                                             | No DN output file specified                                                     |
| **33**                                                             | No keyStore specified                                                           |
| **34**                                                             | No certificate alias or DN specified                                            |
| **35**                                                             | No signing certificate has been provided                                        |
| **36**                                                             | Template identifier not recognized                                              |
| **37**                                                             | No template specified                                                           |
| **38**                                                             | No geographic location specified                                                |
| **39**                                                             | No signer role specified                                                        |
| **40**                                                             | No signer action specified                                                      |
| **41**                                                             | Error reading the xades.properties configuration file                           |
| **File reading**                                                   |                                                                                 |
| **48**                                                             | Error reading the source file                                                   |
| **55**                                                             | Error reading the CA certificate store (truststore)                             |
| **56**                                                             | Error reading the auxiliary file                                                |
| **57**                                                             | The file with the data that was signed in explicit signature was not found      |
| **File writing**                                                   |                                                                                 |
| **64**                                                             | Error writing the destination file                                              |
| **65**                                                             | Error writing the DN file                                                       |
| **66**                                                             | Error writing the response to the request                                       |
| **67**                                                             | Error creating temporary file                                                   |
| **OCSP and CRL validation**                                        |                                                                                 |
| **80**                                                             | Error encoding the certificate                                                  |
| **81**                                                             | Error in the connection with Editran/OCSP                                       |
| **82**                                                             | Error reading Connection Message in EditranOCSP                                 |
| **83**                                                             | The versions do not match each other                                            |
| **84**                                                             | Error writing the Connection response in Editran/OCSP                           |
| **85**                                                             | Error reading connection response in Editran/XAdES                              |
| **86**                                                             | Error reading the request message in Editran/OCSP                               |
| **87**                                                             | Editran/OCSP cannot connect to the OCSP Server                                  |
| **88**                                                             | Error obtaining the Certificate Revocation List (CRL)                           |
| **89**                                                             | The OCSP/CRL URL was not found or could not be connected to                     |
| **File signing**                                                   |                                                                                 |
| **96**                                                             | Error reading the keystore certificate store                                    |
| **97**                                                             | The key could not be extracted from the keystore                                |
| **98**                                                             | The template is incorrect                                                       |
| **Memory error**                                                   |                                                                                 |
| **112**                                                            | OutOfMemoryError                                                                |
| **Unexpected error**                                               |                                                                                 |
| **113**                                                            | Unexpected error                                                                |
| **114**                                                            | Undefined value (should not be reachable)                                       |
| **Signing and verification errors**                                |                                                                                 |
| **10**                                                             | Signing policy violated                                                         |
| **11**                                                             | One of the signing certificates is not trusted, invalid CA                      |
| **12**                                                             | OCSP server returns unknown certificate                                         |
| **13**                                                             | OCSP server or CRL list returns revoked certificate                             |
| **14**                                                             | Expired certificate                                                             |
| **15**                                                             | Document modified                                                               |
| **49**                                                             | Error parsing the XML of the source file                                        |
| **50**                                                             | The element is not found *Signature* in the document                            |
| **51**                                                             | Error parsing the element *Signature*                                           |
| **52**                                                             | Error in the signature validation process                                       |
| **53**                                                             | Error obtaining signature information                                           |
| **54**                                                             | The certificate with which it was signed was not found within the document      |
| **99**                                                             | The element could not be created *SignedInfo*                                   |
| **100**                                                            | The element could not be created *KeyInfo*                                      |
| **101**                                                            | The element could not be created *QualifyingProperties*                         |
| **102**                                                            | Incorrect URL for the signature TimeStamp                                       |
| **103**                                                            | The signer to which the countersignature is applied was not found               |
| **104**                                                            | Error signing                                                                   |

| **Error validating the signature against the profile configured in the application (signers and number of required signatures)** |                                                                                                                                                   |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **16**                                                                                                                           | The required number of signatures is not met: there are users who have not signed, no joint condition is met, some signer is not in the profiles. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.editran.onesait.com/documentacion-editran/publico-editranff-v6.2-windows-en/comandos/xades.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
