PKISimple Remote Signature Server User Manual

Install a signing server on your own IIS web server, keep the keys of your organization on it (a PFX file, the Windows certificate store, or an HSM, smart card or USB token through PKCS#11), and let your applications sign PDF, CMS, XML and ASiC-E documents and hashes, and verify signatures, through a REST API or the CSC API.

1. What is PKISimple Remote Signature Server?

This is the user manual of PKISimple Remote Signature Server 2.1. It explains how to install the server on your own IIS web server, how to give it the certificates of your organization, and how your applications sign and verify documents through its REST API and its CSC API. The latest version of the manual is at https://signfiles.com/manuals/signature-server.

1.1 Server-side signing in a few words

PKISimple Remote Signature Server signs documents and hashes on the server, with the certificates of your organization, for the applications that you authorize. The private keys stay on the server or on its hardware device: an application sends a document or its hash and receives it signed. The same server verifies signatures for the applications and on its own Verify Signatures page, with eIDAS qualification read from the EU trusted lists.

The server runs as an application of Microsoft IIS on your own Windows server and keeps all its data in one SQLite database file in its own folder: no database server is needed. It belongs to the PKISimple family with PKISimple CA Server and PKISimple TSA Server and shares their administration pages, installation, audit trail and backups. Any RFC 3161 time-stamp server, PKISimple TSA Server among them, gives its signatures the time-stamps of levels B-T, B-LT and B-LTA.

1.2 Three things to configure

A client sends the name of a profile and the document; everything else comes from the profile. A client can change only the fields that the profile marks Overridable. A new installation starts with a test signing certificate and five ready profiles, so the first signature takes minutes (Quick start).

1.3 What it signs and verifies

TypeWhat the client sendsWhat it gets back
Hasha digest (SHA-256, SHA-384, SHA-512)the raw signature value (RSA PKCS#1 v1.5, RSA-PSS or ECDSA) and the certificate chain
PAdESa PDF documentthe signed PDF, levels B-B, B-T, B-LT, B-LTA
CAdESany filea CMS signature, attached (.p7m) or detached (.p7s), levels B-B … B-LTA
XAdESan XML document or any filethe XML with an enveloped signature, or a detached XML signature, levels B-B … B-LTA
ASiC-Eseveral filesan .asice container with one XAdES signature
Verificationa signed document (and the originals of a detached signature)a report of every signature: valid, invalid or not verifiable, with the reasons, the exact ETSI profile and the eIDAS qualification

The applications use the REST API (chapter 16) or the CSC API v2 of the Cloud Signature Consortium (chapter 17), with sample programs in nine languages (chapter 18). Documents are signed and verified in memory and never stored.

PartWhat it does
The REST API (api/v1)Signing with a profile, verification, the profiles of a client, health; Swagger documentation (chapter 16).
The CSC API (csc/v2)signHash and signDoc for applications that speak the Cloud Signature Consortium API (chapter 17).
The administration pagesSigning certificates, profiles, clients, Configuration, Trusted Certificates, the Audit Trail, Transactions, Status, Backup and Restore, registration (The main page and the navigation).
ToolsSign a Test Document and Verify Signatures, with downloads of the original document, of every PDF revision and of the signing certificates (Testing the server).
Logs and statusAn Audit Trail protected by a hash chain (chapter 12), a transaction log of every request (chapter 13), and a Status page with daily tests (chapter 14).

1.4 The two editions

Licensed edition (RemoteSignatureServer.zip)Source Edition (RemoteSignatureServer-SourceEdition.zip)
License agreement at the first startyesno
Administrator loginyes (chapter 6)no: every visitor of the pages is the administrator
Trial45 days, 5,000 signatures and 5,000 verifications, then a license (chapter 19)no limit
Default profilesB-B, freely editableB-T with the signfiles.com time-stamp server; locked with their test certificate
Client of the samples—api-samples, with a fixed public API key and CSC PIN: the API samples run against it as they are
API samplesthe folder ApiSamples of the packagealso Download the API Samples on the Configuration page

Everything else works in the same way. The Source Edition is meant for developers and test networks: install it where you trust everybody who can reach it.

WhatAddress
Product pagehttps://signfiles.com/signature-server
This manualhttps://signfiles.com/manuals/signature-server
Live test server (Source Edition, REST and CSC)https://ca.signfiles.com/sign/
SignLib, the signature library of the same familyhttps://www.signfiles.com/signature-library/

2. Requirements and planning

2.1 Requirements

ItemRequirement
Operating systemWindows 10 or Windows Server 2016 or later, with Internet Information Services (IIS).
.NETMicrosoft .NET Framework 4.8, and the ASP.NET 4.8 feature enabled in IIS (Installation on IIS). Windows Server 2016 comes with .NET Framework 4.6.2: install 4.8 first.
Application pool.NET CLR version v4.0 with the Integrated pipeline (the REST API needs it). The server runs in a 64-bit and in a 32-bit pool (it carries the SQLite engine for both). The bitness matters for a PKCS#11 driver: the driver must have the bitness of the pool (chapter 8).
Trust levelFull Trust. In partial trust (Medium Trust, on some shared web hostings) the signing keys and the PKCS#11 devices cannot be used.
DiskA local disk for the application folder (not a network share): the database uses write-ahead logging (WAL), which does not work on network file systems. The account of the application pool must be able to write in the folder App_Data (Files and folders).
ClockThe signing time written in the signatures is the UTC time of the server: synchronize it with an (S)NTP time server. The Status page compares it with the time-stamp servers of the profiles (chapter 14).
CertificatesAt least one signing certificate with its private key (chapter 7). For tests the server can create one (section 7.9).
NetworkThe client applications must reach the IIS site; use HTTPS. For levels B-T and above the server must reach the time-stamp servers of the profiles, and for B-LT, B-LTA and the verification the OCSP responders and CRL addresses of the certificates, directly or through a proxy (section 11.2).
BrowserA current web browser, for the administration pages.

No database server is needed: the server keeps its data in one SQLite database file, App_Data\settings\rss.db, created at the first start.

2.2 Disk space and memory

The database holds the configuration, the certificates, the profiles, the clients, the audit trail and the transaction log. The transaction log grows by one row for each signing or verification request and keeps its rows 365 days by default (chapter 13); the documents themselves are never stored. Add room for the backups made on the server (App_Data\backups): a backup is a full copy of the database. The Status page warns when the free space on the disk of the data folder is under 1 GB or under twice the size of the database.

The documents are signed and verified in memory. A request can carry a document of up to the maximum document size (25 MB by default, at most 100 MB, section 11.1); plan the memory of the server for the number of such requests that can arrive at the same time.

2.3 Decisions before installing

3. Installation on IIS

PKISimple Remote Signature Server is installed as an application of an IIS web site, or as a web site of its own. Use an account with Administrator rights for the steps below. The short version of these steps is in the file Installation.txt of the package.

3.1 Enable ASP.NET

On Windows 10 and Windows 11 open Control Panel → Programs and Features → Turn Windows features on or off. On Windows Server use Server Manager → Add Roles and Features and select the Web Server (IIS) role. Under Internet Information Services → World Wide Web Services → Application Development Features select ASP.NET 4.8. Windows selects the other components that it needs, such as .NET Extensibility 4.8.

3.2 Copy the files

The package (RemoteSignatureServer.zip) contains:

ItemContent
RemoteSignatureServer\The web application: the pages (*.aspx), Web.config, the folder bin and an empty folder App_Data.
ApiSamples\The sample programs in nine languages, for the computers of the developers; not needed on the server (chapter 18).
Installation.txtThe short installation instructions.
Manual.txtThe address of this manual.
License Agreement.txt, THIRD-PARTY-NOTICES.txtThe license terms.

If Windows marks the downloaded zip file as blocked, right-click it, choose Properties and tick Unblock before you extract it; otherwise the database engine in bin\runtimes may not load.

Copy the content of the folder RemoteSignatureServer to a folder of the server, for example C:\inetpub\RemoteSignatureServer (next to the folder wwwroot of IIS, not in it), or a folder on a separate data disk. Do not put it under the folder of another web application.

The package contains no data, no key and no certificate: the database and the key of the installation (secret.key) are created at the first start (Files and folders).

3.3 Create the application pool

A dedicated pool keeps the account of the signing server separate from the other applications of the server, and it is the place where you decide which account runs the server, and so which account uses the keys.

  1. Open Internet Information Services (IIS) Manager and select Application Pools → Add Application Pool...
  2. Type a name, for example SignPool. Select .NET CLR version v4.0 and the Integrated managed pipeline mode.
  3. Keep the default identity, ApplicationPoolIdentity, unless a key must be used by a particular account. The account has the name IIS AppPool\SignPool (the name of the pool, with the prefix IIS AppPool\). The identity can be changed later in Advanced Settings → Process Model → Identity.
  4. In Advanced Settings set Start Mode to AlwaysRunning and, under Process Model, Idle Time-out (minutes) to 0: the server runs its daily tests and writes its alerts by itself, which a stopped pool cannot do.
Tip

Write down the identity of the pool. The rights on the folder, on the private keys of the Windows store and on the PKCS#11 devices are checked for that account (section 7.6).

The setting Enable 32-Bit Applications of the pool decides whether the server runs as a 64-bit or a 32-bit process. Both work. It matters only for a PKCS#11 driver, which must have the same bitness as the pool.

3.4 Add the application

In IIS Manager right-click the web site (for example Default Web Site) and select Add Application...

FieldValue
Aliassign (the alias becomes part of the address)
Application poolSignPool (press Select... to choose it)
Physical pathC:\inetpub\RemoteSignatureServer (the folder that contains Default.aspx and Web.config)

The address of the server is then http://localhost/sign/ on the server itself, or https://your-server/sign/ from the network; the REST API is at https://your-server/sign/api/v1/. The server also works at the root of a web site of its own (https://sign.example.com/): create the site with the same pool and folder.

Optional: to avoid a first answer of several seconds after a restart of the pool, install the IIS feature Application Initialization and set Preload Enabled to True in the Advanced Settings of the application (with the pool's Start Mode AlwaysRunning, section 3.3).

3.5 Give the application pool the rights it needs

The server writes only in its folder App_Data: the database, its backups and a few other files (Files and folders). The account of the application pool needs the Modify right on it. From a Command Prompt run as Administrator:

Command Prompt
icacls "C:\inetpub\RemoteSignatureServer\App_Data" /grant "IIS AppPool\SignPool:(OI)(CI)M"

Use the account of your pool. For a custom identity use DOMAIN\user or COMPUTER\user. The rights are inherited by the files and folders that the server creates later.

Note

If the folder is not writable, the pages show a red message that begins with "The application cannot write to its data folder" followed by the path of the folder. Give the account of the pool the Modify right and reload the page. Remote visitors see only "The server has a configuration problem. The details are shown when this page is opened on the server itself (http://localhost/...), and in the Audit Trail."

3.6 IIS authentication and HTTPS

In IIS Manager select the application, then Authentication:

Use HTTPS. Add an HTTPS binding to the web site with a server (TLS) certificate. The API keys, the CSC PINs and the documents travel in the requests; over plain HTTP they are readable on the network, and so are the administrator password and the login cookie. The login page then warns "This connection is not encrypted (HTTP): the password is sent in clear text. Use HTTPS when the server can be reached from other networks." The CSC API refuses plain HTTP. See Security recommendations.

3.7 First start

Open the address of the application in a browser on the server itself, for example http://localhost/sign/.

  1. License agreement. The first page shows the license agreement. Scroll to its end, tick I have read the license agreement and I accept its terms and press Accept and Continue (the box can be ticked only after the agreement was scrolled to its end). Until the agreement is accepted and the administrator account is created, the server refuses every signing request with "The server is not installed yet: its administrator must open the administration pages, accept the license agreement and create the administrator account."
  2. Administrator account. The page Create an administrator account asks for a Username and a Password; press Create Account. Until the account exists, anyone who opens the page can create it: do it yourself, right away, before you give the address to anybody (License agreement and administrator account).
  3. The main page opens. It says that there is no signing certificate yet. Continue with the Quick start: a certificate, a profile, a client.
License agreement page
The license agreement. The check box can be ticked only after you scroll to the end.
Warning

Until the administrator account exists, the first person who opens the pages creates it, from any computer. Complete the first start yourself, right after copying the files, before you give the address to anybody.

If you get an error page instead of the first page, check:

Warning

Before you sign for real, make sure that the clock of the machine is synchronized with an (S)NTP time server (on Windows: the Windows Time service). The signing time written in the signatures is the time of the machine; the time stamps of levels B-T and above come from the time-stamp server.

Source Edition: there is no license agreement and no administrator account. The administration pages have no login: everybody who can open them can change the certificates, the profiles and the clients, and can read the logs. Install the Source Edition only where you trust everybody who can reach it, and do not publish it on the internet.

3.8 Shared web hosting

The server can also run at a hosting provider that offers ASP.NET 4.8 on IIS. Web.config is written for that: it has no sections that hosting providers usually lock (no <handlers> or <modules>), and the data files are in App_Data, which IIS and ASP.NET never serve. Check with the provider that:

Upload the content of the folder RemoteSignatureServer with the whole bin folder, then open the site and continue as in 03.7. If something fails at the start, App_Data\settings\startup-error.txt (readable with the file manager or FTP of the provider) holds the reason.

PKCS#11 devices and the Windows certificate store of the machine are usually not available at a hosting provider: use a PFX file.

3.9 Updating an installation

To install a newer build over an installation that works: make a backup first (Backup, restore, move and upgrade), stop the application pool, copy the new files over the old ones and start the pool again. Never delete or replace the folder App_Data: it holds the data of the server, including the file secret.key, without which its PFX files and passwords cannot be read.

Warning

When you upload the new files with FTP, do not use a "mirror" or "synchronize" mode that deletes on the server the files that are not on your computer: it would delete App_Data and the data of the server.

4. The main page and the navigation

4.1 The menu bar and the bottom bar

Every administration page has the same dark bar at the top: Main, Signing Certificates, Profiles, Clients, Configuration, Transactions, Audit Trail, Status, Backup, Tools and, on the right, Log out. The current page is underlined. On a phone the links move to a second row.

Every page ends with the same bar: on the left the way back (← Main Page, or ← Signing Certificates on the page of one certificate), on the right the actions of the page, the main one in blue. Buttons inside a section (Load Certificate, Test the Key, Check…) are small and stay under their fields.

A change is saved only when you click its Save button. If you leave a page with changes that are not saved, the browser asks first.

4.2 The main page

Main page of a new installation
The main page of a new installation: no signing certificate yet, the trial, the addresses of the APIs.

5. Quick start

From a new installation to a first signed PDF, in five steps. The steps use a certificate made by the server for tests; for real signatures add the certificate of your organization instead (chapter 7). The examples use the address https://sign.example.com/sign/: write the address of your server.

A new installation already has a test certificate and the five default profiles pades, cades, xades, asice and hash (chapter 9): with them you can go straight to step 3. Steps 1 and 2 show how to add your own.

5.1 A signing certificate

  1. Menu Signing Certificates → Create a Certificate for Tests.
  2. Type a Common Name, for example Example Seal (test), and a PFX password of at least 10 characters.
  3. Keep Add as a signing certificate ticked and click Create Certificate.

The certificate appears on the Signing Certificates page as Usable, labelled "(test certificate)" (section 7.9).

5.2 A profile

  1. Menu Profiles → Add a Profile.
  2. Type PAdES, Name invoices, Signing certificate the certificate of step 1, Level B-B (a level with a time stamp needs the address of a time-stamp server).
  3. Click Add the Profile.

5.3 Try the profile

Menu Tools → Sign a Test Document: choose the profile invoices, select a PDF file and click Sign. A green line says that the document was signed and that the signature was verified; Download saves the signed PDF. Open it in a PDF reader: the signature panel shows the signature, with a warning that the test certificate is not trusted (section 15.1).

5.4 A client

  1. Menu Clients → Add a Client.
  2. Name erp, tick the profile invoices under Allowed profiles, and click Add the Client.
  3. Click Generate a Key and copy the key: it is shown only once (section 10.3).

5.5 Sign through the REST API

With PowerShell 7 or Windows PowerShell 5.1, on any computer that reaches the server:

PowerShell
$server = "https://sign.example.com/sign/"
$key = "<the API key of step 4>"
Invoke-RestMethod "$($server)api/v1/health"
$pdf = [Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\Temp\invoice.pdf"))
$body = @{ profile = "invoices"; document = $pdf; fileName = "invoice.pdf" } | ConvertTo-Json
$answer = Invoke-RestMethod "$($server)api/v1/sign/pades" -Method Post -ContentType "application/json" `
    -Headers @{ Authorization = "Bearer $key" } -Body $body
[IO.File]::WriteAllBytes("C:\Temp\invoice-signed.pdf", [Convert]::FromBase64String($answer.content))

The first call answers healthy; the last one writes the signed PDF. The signature is a line of the Transactions page (chapter 13), counted for the client and for the trial.

Next:

6. License agreement and the administrator account

The license agreement. A new installation first shows the license agreement. The box "I have read the license agreement and I accept its terms" can be ticked only after you scrolled the agreement to its end. Until the agreement is accepted and the administrator account is created, the server signs nothing.

The first start. After the agreement, the login page asks you to create the administrator account: a user name and a password. Until it exists, anyone who opens the page can create it.

Create an administrator account
The first start: create the administrator account.
Warning

Create the account yourself, right after the installation, before you give the address to anybody.

Log in. Enter the user name and the password and click Log in. After several wrong passwords the page makes you wait before the next attempt. Log out on the right of the bar ends the session.

Login page
The login page, opened over HTTP.

Forgotten password.

  1. On the server, create an empty file reset-admin.txt in App_Data\settings.
  2. Open the login page: the server writes a one-time code into the file.
  3. Enter the code, a new user name and a new password on the login page.

The previous account and every login session end, and the file is deleted. The code is valid for one hour and is replaced after five wrong attempts. To cancel a reset, delete the file and reload the login page.

Tip

the login page warns when the connection is not encrypted. Use HTTPS when the administration pages can be reached from other networks.

# 07. Signing certificates

A signing certificate is a certificate with its private key that the server signs with. Each profile signs with one certificate; one certificate can serve several profiles. Add as many as you need: for example one company seal for invoices and another for contracts.

A new installation already has one, "Test Signature Certificate (test certificate)", made for its default profiles (chapter 9). In the Source Edition this certificate cannot be changed or deleted (the page says so and refuses Save Changes); you can still add other certificates for your own profiles.

The key stays where it is:

SourceWhere the key isChapter
PFX or P12 filethe file is uploaded once and kept by the server, encrypted, with its password7.3
Windows certificate storethe personal store of the machine (Local Machine) or of the account of the server (Current User)7.4
PKCS#11 devicean HSM, a smart card or a USB token; the server logs in with its PIN8

The server keeps the certificate chain (the issuers up to the root) with each certificate and puts it in the signatures, so that the people who check a signature can follow it to a certification authority they trust.

7.1 Certificate requirements

RequirementWhy
An RSA or ECDSA keythe signature formats of the server sign with these keys
Inside its validity perioda signature made with an expired certificate is not valid
Key Usage Digital Signature or Non Repudiation, when the certificate has a Key Usagea certificate made for encryption only cannot sign documents
A private key that the account of the server can usetested when you choose the certificate (7.5)

The page also warns, without refusing the certificate, when:

For signatures that are recognised in the European Union, use a certificate for electronic seals issued by a trust service provider, kept on a device that the provider allows.

7.2 The Signing Certificates page

Menu Signing Certificates. The table shows every certificate with:

Signing Certificates page
The Signing Certificates page with one certificate and the profiles that sign with it.

The buttons of a row: Edit opens the certificate, Test the Key signs a test message with it (7.5), Delete deletes it (7.8). Add a Signing Certificate at the bottom opens the page of a new certificate.

7.3 Add a certificate from a PFX or P12 file

  1. On the Signing Certificates page click Add a Signing Certificate.
  2. Type a Name, or leave it empty to use the common name of the certificate.
  3. Keep Certificate from a .PFX or .P12 file selected.
  4. Press Choose File, select the file, type its password and click Load Certificate.
  5. The certificate appears as Selected certificate, with its chain. The server signs a test message with its key at once and says whether the certificate can sign.
  6. Click Add the Signing Certificate.

The file must contain the private key. A file that is loaded but never saved is deleted from the server after an hour.

Tip

keep your own copy of the PFX file and its password in a safe place. The server's backups contain the file (chapter 20), but a copy of your own lets you install the certificate on another server.

7.4 Add a certificate from the Windows certificate store

Use this source when the certificate is already installed on the server, for example by your IT department or by the software of a token.

  1. Click Add a Signing Certificate and type a Name (or leave it empty).
  2. Select Certificate from the Windows certificate store.
  3. Choose the Certificate store: Local Machine (recommended) or Current User (the personal store of the account that runs the server).
  4. Choose the certificate in Certificates on store. Each entry shows its expiry date; the ones that cannot sign are marked "cannot sign", those installed without a private key "no private key".
  5. The server tests the key at once (7.5). Click Add the Signing Certificate.

The server signs with the key in the store: if the certificate is removed from the store, or renewed with a new thumbprint, choose it again (7.8).

7.5 Test the Key

Test the Key signs a short test message with the private key, as a signature request will, and checks the signature with the certificate. Nothing is saved and the test does not count as a signature.

A failed test says why (7.7). The certificate cannot be saved until the test passes.

7.6 The private key and the application pool

The server runs under the identity of its IIS application pool, for example IIS AppPool\SignPool. That account, not your own, must be able to use the private key:

7.7 Key errors and solutions

The messages explain the error first and then give the original text and code of Windows, so that you can search for them.

Message (beginning)What to do
The private key of the certificate was not foundThe certificate is installed without its key. Install it again together with the key (from the PFX file).
The server cannot open the private key of the certificate ("Keyset does not exist", "Invalid provider type specified")The account of the server has no right to read the key, or the key was installed for another account. Give the account read access (7.6).
The account that runs the server (…) is not allowed to use the private keyGive the account named in the message read access to the key (7.6).
The private key needs a person to answer (a PIN or a confirmation window)A service cannot answer a prompt. Use a key without confirmation, or a PKCS#11 device (8).
The certificate (thumbprint …) was not found in the Windows certificate storeThe certificate was removed or renewed. Install it again, or choose the new certificate (7.8).
The PFX file cannot be opened: the password is wrong or the file is not a PFX / P12 fileCheck the password and the file.
The selected certificate cannot sign: …The certificate does not meet a requirement of section 7.1; the message names it.

7.8 Change or delete a certificate

Change. Click the name or Edit. The Current certificate stays at the top. You can:

The page of a signing certificate
The page of a signing certificate: its state, the current certificate with its chain, and the sources to choose another one.

If somebody else changed the certificate while you had the page open, the server does not overwrite that change: open the page again and repeat yours.

Delete. Click Delete on the Signing Certificates page and confirm. A certificate that a profile uses cannot be deleted: choose another certificate in those profiles first. A certificate of the Windows store or of a device stays there; the encrypted PFX file of a deleted certificate is removed from the server within an hour.

Every addition, change and deletion is written to the Audit Trail (chapter 12), without any password or PIN.

7.9 Create a certificate for tests

For tests and demos the server can create a self-signed signing certificate with its private key. The validators trust its signatures only if they trust this certificate itself: for real signatures use a certificate issued by a certification authority.

Create a Certificate for Tests page
Create a Certificate for Tests.
  1. On the Signing Certificates page click Create a Certificate for Tests.
  2. Enter the Common Name (required) and, if you want, the organization, the unit, the e-mail address and the two-letter country code.
  3. Choose the Validity period (at most 10 years), the Key algorithm (RSA 2048, 3072 or 4096 bits, or an elliptic curve P-256, P-384 or P-521) and the Certificate signature hash.
  4. Enter the PFX password: at least 10 characters, 16 or more random characters recommended.
  5. Keep Add as a signing certificate ticked to save it at once as a signing certificate of the PFX source; its name (the Name of the signing certificate, or the Common Name) gets the label "(test certificate)". Untick it to create only the PFX file.
  6. Click Create Certificate, then Download the PFX File if you want a copy: a file that no signing certificate uses is deleted from the server within an hour.

The certificate has the Key Usage Digital Signature and Non Repudiation (critical). The page warns when an RSA key below 3000 bits does not meet ETSI TS 119 312 for the chosen dates. The PFX file is protected with 3DES, which every supported version of Windows (Windows Server 2016 included) opens. An edition of the server built without the SignLib license serial creates certificates valid for 30 days at most; the page says so.

7.10 Complete the chain

The signatures embed the chain of the signing certificate: the certificate and its issuers up to the root. The server builds it from the PFX file and from the certificates Windows knows. When an issuer is missing (a PFX file exported without the chain, a .cer file of a device), the edit page shows "the issuer of the last certificate was not found".

To complete it, open the certificate (the box Complete the chain is shown only while the chain does not end with a root), choose the issuer certificates under Complete the chain (.cer, .crt, .pem or .p7b; several files, or a file with several certificates) and click Add to the Chain. The server keeps only the certificates that are issuers of this chain (same name and a valid signature) and saves the chain at once; the next signatures embed it. Choosing the certificate again builds the chain again from its source.

7.11 Expiry warnings

WhenMain pageStatus page, line "Signing certificates"
Less than 30 days before the end of validityyellow warningwarning
Less than 7 days before the end of validityred warningerror
Expired, not valid yet, or the key cannot be loadedred warningerror

The Signing Certificates page shows the same state for each certificate. Renew the certificate (or choose or create another one) and save it before that date: the profiles keep pointing to the signing certificate. The server also writes an alert to the Audit Trail at 30 days, at 7 days and when the certificate has expired (chapter 14).

7.12 Check the revocation before signing

Check the revocation before each signature (on the page of a signing certificate, off by default): before every signature the server asks the OCSP responder of the certificate (or downloads its CRL), and the same for its CA certificates, through the chain shown on the page. The answers are kept for the lifetime of the revocation cache (1 hour by default). A revoked certificate signs nothing (CERTIFICATE_NOT_VALID); when the status cannot be obtained, the request is refused too (REVOCATION_DATA_UNAVAILABLE, try again later). It adds the time of one OCSP request to the first signature after the cache expires. B-LT and B-LTA signatures fetch this data anyway.

Outgoing calls. The server calls the TSA of the profiles and the OCSP responders and CRL addresses of the certificates. The configuration has a proxy for these calls (with a user and a password, stored encrypted), a timeout (10 seconds), the lifetime of the revocation cache (1 hour) and Block private addresses (on): an OCSP or CRL address of a certificate that points to the server itself or to a private network is never contacted, against requests forged through certificates. Turn it off only for a CA of your own network. These settings are in the Network section of the Configuration page (section 11.2).

8. HSM, smart cards and USB tokens (PKCS#11)

With a PKCS#11 device the private key never leaves the device: the server sends it what to sign and receives the signature. The server talks to the device through the PKCS#11 driver (a .dll) of its vendor and logs in with the user PIN.

8.1 Before you start

8.2 Add the certificate of a device

  1. Click Add a Signing Certificate and type a Name (or leave it empty).
  2. Select Key on an HSM, smart card or USB token (PKCS#11 driver).
  3. Enter the PKCS#11 driver path, for example C:\Program Files\SafeNet\LunaClient\cryptoki.dll: a full path on a local disk.
  4. Enter the Slot number, the Device User PIN and the number of Parallel sessions: 1 for smart cards and USB tokens, 4 or more for network HSMs (at most 32). This is the number of signatures the device makes at the same time. It is the throughput setting of the device: when many clients sign at the same time through one network HSM, the signatures wait for a free session, so raise it as far as the device and its license allow.
  5. Choose the Public certificate (.CER) and click Test the Key. The server logs in to the device, signs a test message with the key of the certificate and checks the signature.
  6. When the test passes, click Add the Signing Certificate.

Change the PIN or the sessions. Open the certificate, type the new PIN or number of sessions, leave the .CER empty, click Test the Key, then Save Changes. An empty PIN box keeps the saved PIN of the same driver and slot.

8.3 Tips and messages

Message (beginning)What to do
The driver file does not existCheck the path and the processor architecture of the driver.
… PIN …The device refused the PIN: correct it and test again before the device locks it.
The rejected PIN is not sent againA signature met a PIN that the device refused: correct the PIN, then Test the Key.
The test signature … does not match the public key of the selected certificateThe .CER file is not the certificate of the key on that slot: choose the right file or slot.

# 09. Profiles

A profile is what a client asks for by its name: the type of signature, the signing certificate and every setting of the signature. The client sends the document (or, for a Hash profile, the digest) and only the fields that the profile marks Overridable; a request that sets any other field is refused.

The default profiles. At its first start (in the licensed edition: once the license agreement is accepted) a new installation creates a self-signed test signing certificate, "Test Signature Certificate (test certificate)" (subject CN=Test Signature Certificate, OU=MyUnit, O=MyOrganization, C=US) (a new RSA 2048 key of its own, valid 10 years), and five Active profiles that use it: pades, cades, xades, asice and hash, each of the type of its name, with the default settings. The document profiles are at level B-B in the licensed edition and at level B-T, with the time-stamp server https://ca.signfiles.com/TSAServer.aspx, in the Source Edition. In the licensed edition they are ordinary profiles: choose the certificate of your organization, change, rename or delete them. In the Source Edition they cannot be deleted, renamed or deactivated and keep the certificate created at installation (the Profiles page shows no Delete for them; on their page the name, Active and the certificate are read-only, with the reason); their other settings can be changed, and other profiles can be added freely. This happens once: a deleted default profile never comes back, and an installation that already has a certificate, a profile or a client, or that was restored from a backup, gets nothing. The Audit Trail records it ("Initial setup: …"); if it fails, the server tries again every minute.

The Profiles page (menu Profiles) lists the name and description, the type, the signing certificate, the main settings, the state (active, not active, or a certificate that cannot sign now) and the number of clients allowed to use the profile. Edit opens it; Delete removes it together with the permissions of its clients.

Profiles page
The Profiles page: one profile of each type.

Add a profile. Click Add a Profile, choose the Type (it cannot be changed later), then:

The page of a PAdES profile
The page of a PAdES profile.
FieldWhat it does
NameLetters A-Z, digits, - and _, unique (upper and lower case are the same name). The clients send it: profile in the REST API, credentialID in the CSC API.
DescriptionShown to the clients (at most 256 characters).
ActiveNot active: every request for the profile is refused, as if it did not exist. The Sign a Test Document page can still sign with it.
Signing certificateThe certificate the profile signs with (chapter 7). A certificate used by a profile cannot be deleted.
Hash algorithmSHA-256, SHA-384 or SHA-512. SHA-1 is not offered (ETSI TS 119 312).
Minimum remaining daysRequests are refused when the certificate has fewer days of validity left (0 = until it expires).
CSC signatures per authorizationHow many hashes one CSC authorization may sign (1–100).

Hash profiles sign the digest a client sends: the accepted digest algorithms, the RSA padding (PKCS#1 v1.5 or PSS) and the ECDSA encoding (DER or raw r‖s, overridable). The page says it plainly: the server signs any digest an authorized client sends, without seeing the document. Allow a Hash profile only to clients you trust with the key.

PAdES, CAdES, XAdES and ASiC-E profiles have a Level: B-B (basic), B-T (with a time stamp), B-LT (with the validation data) or B-LTA (with an archive time stamp). From B-T the profile needs a TSA URL; a fallback URL, a user and password (stored encrypted; leave the box empty to keep the saved one), a policy OID and the hash of the time stamp request are optional. For B-LT and B-LTA the signature fails when the revocation data cannot be fetched, unless Allow level T is ticked (the transaction then says so). Certificates included: the chain without the root (the default), the signing certificate only, or the whole chain with the root.

The server checks every profile before it saves it and refuses one that could not sign, with the reasons. Every addition, change and deletion is written to the Audit Trail with the old and new values, never with a password. A change applies to the next request at once.

Sign a Test Document tries a profile before the clients use it, also a profile that is not Active yet (section 15.1).

# 10. Clients and API keys

A client is an application that signs through the server: an ERP, a document management system, a script. Each one has its own API key, so you can see who signed what, limit each one and stop one without touching the others.

10.1 The Clients page

Clients in the menu lists every client: its state (green when it can work, amber when it is enabled but has no API key yet or may do nothing (no profile and no verification), grey when it is disabled), its Operations (Sign when it has an allowed profile, Verify when it may verify signatures), the key id of its API key with the time it was generated, the profiles it may use, the signatures of today and of this month (with the quota, when there is one), its IP allow-list and when and from which address it last authenticated. Add a Client opens an empty client; the name or Edit opens one; Delete removes it and its API key stops working at once.

Clients page
The Clients page with two clients.

Source Edition. The Source Edition starts with the client api-samples, made for the API samples (chapter 18): all default profiles, May verify, CSC access, no quota and no address list, with a fixed API key and a fixed CSC PIN that are public (they are in the samples and on the Configuration page). It cannot be deleted, renamed or disabled, its CSC access cannot be turned off and its key and PIN cannot be replaced or removed (its page shows them; the buttons answer with the reason); its other settings can be changed. Add other clients, with keys of their own, for your applications: they work as in the licensed edition.

10.2 Add or change a client

FieldWhat it does
NameLetters, digits, _, . and -, at most 64 characters, unique (in any case). It names the client in the logs.
EnabledOff: every request of the client is refused (its key and settings stay).
Allowed profilesThe profiles the client may use. None by default: for any other profile the client gets "profile not found", as if it did not exist.
Signatures per day / per monthQuotas in UTC days and months (0 to 1,000,000,000; empty = unlimited). The day quota cannot be higher than the month quota.
IP allow-listIP addresses and ranges, IPv4 or IPv6 (192.168.10.0/24, 2001:db8::/32), separated by commas or new lines. Empty: any address. The page shows your own address as the server sees it.
Allowed operationsSign: with the allowed profiles above (no profile: the client cannot sign). Verify: may verify signatures: the client may call the verification endpoints (verify, section 16.12). Off by default; it needs no profile.
Verifications per day / per monthQuotas of verifications (verify and verify/certificate; verify/policy is free), counted apart from the signatures, in UTC days and months (0 to 1,000,000,000; empty = unlimited). The page shows the verifications of today and of this month.
CSC accessThe client may log in to the CSC API with its name and its CSC PIN (chapter 17). Off by default.
CSC PINGenerate a PIN makes 16 random letters and digits, shown only once; or type a PIN of 6 to 32 printable characters without spaces and click Set this PIN; Remove the PIN. The server keeps only a fingerprint of it. A new or removed PIN ends the CSC sessions of the client at once.

Add the Client saves it and keeps the page open, so that you can generate its key. The server checks every value before it saves and refuses a wrong one with the reason. Every addition, change and deletion is written to the Audit Trail with the old and new values. A change applies to the next request.

The page of a client
The page of a client: its API key (only the key id is shown), its profiles and its limits.

10.3 The API key

The key is made by the server: 32 random bytes written as 43 letters, digits, - and _. Click Generate a Key on the page of the client. The key appears once, in a green box with a Copy button: copy it and give it to the application, which sends it with every request:

Text
Authorization: Bearer <the API key>

The server does not keep the key. It keeps only a fingerprint of it (an HMAC computed with the secret of the installation) and the first 8 characters of that fingerprint, the key id, which names the key on the pages and in the logs. Neither the key nor its fingerprint can be turned back into the key, so a lost key cannot be shown again: generate a new one.

Both are written to the Audit Trail with the key ids, never with a key.

Backups. A backup holds the fingerprints, not the keys. The keys keep working after a restore only with the secret.key of the same installation; the check of a backup file says so (line "Client API keys").

10.4 Quotas

A signature is counted against the day and the month of the client before it is made and given back when it fails, so a refused or failed request costs nothing. A request over a quota is refused. Inside one worker process the quotas are exact; with several worker processes (a web garden) they can be exceeded by the signatures of about one second, and if the application pool stops abruptly the signatures of the last second are not counted. The counts of a day are kept 62 days, those of a month 25 months.

Verifications have quotas of their own (Verifications per day / per month), counted the same way and never against the signatures: one per verify or verify/certificate request, given back when the request is refused after the quota check (an unsupported document, a busy server, a timeout), so only a report costs one. Over a quota the client gets 429 QUOTA_EXCEEDED with Retry-After (the next UTC day or month).

10.5 Addresses, proxies and wrong keys

The IP allow-list is checked against the address that connected to the server. When the server is behind a reverse proxy or a load balancer, that address is the proxy's; the server then reads the client address from the X-Forwarded-For header, but only from the trusted reverse proxies of the server settings (section 11.1), so that nobody else can choose the address that is checked.

After 5 wrong API keys from one address, the requests with a key from that address are refused for 1 minute, then 2, 4, 8 and at most 15 minutes for each further wrong key. A key that has already worked keeps working, so a client is not stopped by wrong keys that somebody else sends from the same address. Each block is written once to the Audit Trail ("Client authentication failures"). The wrong keys themselves are never written anywhere.

# 11. Server settings

Configuration in the menu opens the settings of the server. A change is used by the next request, without a restart, and every changed value is written to the Audit Trail with its old and new value. Save Configuration saves the whole page. The links at the top of the page jump to its five sections: General, Network, REST API, CSC API and Signature Verification. Each section says who uses it: General, Network and REST API are used by signing and verification, CSC API by signing only, Signature Verification by verification only. Restore Defaults in the title of a section fills that section with its default values (after a confirmation); they are saved only when you click Save Configuration. A value marked as risky below is saved with a warning. The retention of the transaction log is set on the Transactions page (chapter 13), the time of the daily tests on the Status page (chapter 14).

Configuration page
The Configuration page: the index of its sections, a Restore Defaults per section, Save Configuration always in view.

11.1 General

SettingDefaultWhat it does
Public addressemptyThe address the clients use, for example https://sign.example.com/sign/ (the server adds the final /). Shown on the main page, in the API documentation and in the CSC info. Empty: the address of each request (the page shows it).
Maximum document size (MB)251–100. A larger document is refused with DOCUMENT_TOO_LARGE; a profile can only lower it. The page shows the largest request the server reads (the document in Base64 and the JSON around it, 36 MB for 25 MB). The verification accepts 5 MB more (a signed copy is larger than the document; 16.4).
Document signatures at the same timethe number of processors1–64. PAdES, CAdES, XAdES and ASiC-E requests (and CSC signDoc) above this number wait at most 5 seconds, then get 503 SERVER_BUSY with Retry-After; a waiting request is read only when its turn comes, so the limit also bounds the memory the server uses for large documents. Hash signatures, the daily tests and the test page are not counted. Raise it on a server with much memory and many processors; lower it when large documents make the server slow.
Trusted reverse proxiesemptyAddresses and ranges (IPv4 or IPv6, 10.0.0.0/24), separated by commas or new lines. Only a request from one of them may give the address of the client in X-Forwarded-For (IP allow-lists, wrong-key blocks, logs). Empty: the header is ignored.

11.2 Network (outgoing calls)

The calls of the server to the time stamp authorities and to the OCSP responders, CRLs and issuer certificates named in the certificates, for signing and for verification.

SettingDefaultWhat it does
HTTP proxy, proxy user, proxy passwordemptyFor example http://proxy.example.com:8080/. Empty: the proxy of the system. The password is stored encrypted and never shown: leave its box empty to keep it; it is removed when the user is emptied.
Network timeout (seconds)102–60, for each outgoing call.
Revocation cache (hours)10–24; 0: not kept. Never beyond the next update of the CRL or OCSP response.
Block private addresses in the URLs of the certificatesonAn OCSP, CRL or issuer address inside a certificate that points to this computer or to the local network is not called (requests forged through certificates). Risky when off; turn it off only for a CA of your own network.

11.3 REST API

The section shows the address of the API (<server address>/api/v1/). In the Source Edition the REST API, the CSC API (11.4) and the verification API (11.5) are always on: saving the page with one of them off is refused, because the API samples use them. The Source Edition also shows here Download the API Samples, with the public API key and CSC PIN of the client api-samples and the address to give the samples.

SettingDefaultWhat it does
REST API enabledonOff: every call under api/v1 except health is refused with 403 API_DISABLED, whatever the key. The CSC API has its own switch.
API documentation (Swagger) enabledonThe interactive documentation at <server address>/swagger and its description swagger/docs/v1. Off: both answer 404.

Wrong API keys are blocked by address (fixed): after 5 failures 429, first for a minute, the block doubling up to 15 minutes; each block is written once to the Audit Trail. The Source Edition also has Download the API Samples here: the samples of chapter 18, to run with the address of the site and the key of a client.

11.4 CSC API

The section shows the address of the CSC API (<server address>/csc/v2/); chapter 17 describes it.

SettingDefaultWhat it does
CSC API enabledoffOff: csc/v2 answers 404. On (risky): a client with CSC access signs with its name and CSC PIN only (sole control level 1, no second factor).
Access token lifetime (minutes)151–60: the expires_in of auth/login.
SAD lifetime (minutes)51–60: the expiresIn of credentials/authorize.
RegionROTwo letters (ISO 3166-1): the region of info.
Ask the PIN again at credentials/authorizeoffFor signing applications that always prompt for a PIN: credentials/info then lists one PIN object.
signDoc enabledonThe server signs whole documents with the profile. Off: signDoc is not in info and answers 501; signHash still works.

Wrong PINs are blocked per address and per client (fixed): after 5 failures auth/login answers 429, first for a minute, the block doubling up to 15 minutes.

11.5 Signature verification settings

The section is used by verification only. Its settings are in groups: Trust, Revocation, Algorithms, Limits, Privacy and Tools.

SettingDefaultWhat it does
Verification API enabledonThe clients that may verify (section 10.2) can call verify, verify/policy and verify/certificate. Off: every client gets 403 OPERATION_NOT_ALLOWED; the Verify Signatures page still works.
Trust the Windows trusted root certification authoritiesonAlso trusts the root store of this computer. Two servers with different root stores may then report the same signature differently. Off: only the Trusted Certificates list (and the EU trusted lists, below) is trusted. Trust is information in the report: it never makes a signature valid or invalid.
Trust the qualified trust services of the EU trusted lists (eIDAS)onLooks up the certificates in the EU trusted lists (section 11.7): the report shows the eIDAS qualification (the eIDAS mark), and the CA of a qualified certificate and a qualified time-stamping unit named by the EU trusted list of their country are trusted without being in the Trusted Certificates list. Off: nothing is downloaded and no eIDAS mark is shown.
Use a downloaded list for (days)71–30. After that, a list is asked for again, only when a verified document needs it.
Revocation checkingOCSP, then CRLOr OCSP only, CRL only, None. A certificate revoked before the signature time makes the signature invalid. With None every signature gets the warning that the revocation was not checked (risky).
Fetch revocation data onlineonOff: only the validation data inside the signature (B-LT, B-LTA) is used.
Check the revocation of the CA certificatesonThe intermediate authorities of the chain are checked too (risky when off).
Minimum RSA / DSA key size; minimum EC key size2048; 2561024–4096 and 160–521 bits. A smaller key gets the warning MSG-WEAK-ALGORITHM; it does not change the result. Lower values are risky.
Accept SHA-1 with a milder warningoffOff: SHA-1 gets MSG-WEAK-ALGORITHM, as MD5 always does. On: MSG-WEAK-ALGORITHM-ALLOWED (risky; for old archives).
Original files per request101–100.
Signatures per document1001–1000. A document with more signatures: the first ones are reported and the result is at best "not verifiable".
Verifications at the same timethe number of processors1–64. As many more requests wait at most 5 seconds, then 503 SERVER_BUSY. A waiting request is read only when its turn comes (also on the Verify Signatures page), so the limit also bounds the memory the server uses for large documents.
Time budget (seconds)6010–300. Longer: 504 VERIFICATION_TIMEOUT.
Write the first signer's common name to the transaction logoffPersonal data (risky): only the common name, never the whole subject.

B-LT and B-LTA are reported only when the signature carries the complete validation data (fixed). The maximum document size, the network timeout, the proxy of the outgoing calls and the blocking of private addresses are shared with signing; the page shows their values.

Verify a Test Document verifies a small fixed sample (an attached CAdES signature by a self-signed test certificate, not a certificate of this server) with the saved settings, as the Verify Signatures page does. The expected answer is "valid" with warnings; anything else means the verification of the server does not work. It is not counted and writes one transaction-log row without a client. Clear Revocation and Certificate Caches forgets the downloaded OCSP responses, CRLs and certificates (shared with signing), so the next verification downloads fresh revocation data; the action is written to the Audit Trail. Delete the Cached Trusted Lists deletes the EU trusted lists kept by the server (section 11.7); the action is written to the Audit Trail.

11.6 Trusted Certificates

The Trusted Certificates button of the Configuration page (or the link of the main page) opens the list of the certificates the verification trusts. A trust anchor is a certificate (usually a root certification authority) that the chain of a signature may reach; an intermediate only helps to build chains and is never trusted. The list is information for the reader of a report (trust.chainsToTrustedCertificate): it never makes a signature valid or invalid.

Trusted Certificates page
The Trusted Certificates list of a new installation.

The list shows each certificate's label, role, subject, issuer, validity, SHA-256 fingerprint (compare it with the fingerprint published by the certification authority) and state: enabled, disabled, expiring in less than 30 days or expired (an expired anchor stays an anchor; signatures that chain to it get a warning: replace or disable it). Disable / Enable takes a certificate out of the verification without deleting it; Delete asks for a confirmation. To add certificates, choose a Certificate file (.cer, .crt, .pem or .p7b; every certificate of the file is added; a file with a private key is refused), its Role and an optional Label, and click Import. A certificate already in the list is refused. Every change is used by the next verification and written to the Audit Trail; the list is part of the backup.

11.7 EU trusted lists

The European Union publishes, for every member state, a trusted list of the qualified trust service providers and their services (eIDAS, Regulation (EU) No 910/2014), and one list of the lists that points to them. With Trust the qualified trust services of the EU trusted lists (eIDAS) on (the default), the server looks up the certificates of the signatures it verifies in these lists, with Secure Soft's EUTLValidator library, to tell whether they are qualified, and trusts the qualified services the lists name (below).

What the server downloads, and when:

The lists never make a verification fail: a certificate that is not qualified, or a list that cannot be had, only means that no eIDAS mark is shown. A certificate whose authority is listed by another member state than the country in its issuer name is not found (the other countries' lists are never downloaded).

The answer is in the qualification field of the verification report of the REST API (section 16, point 6 of the report): the eIDAS mark (QESig, QESeal, AdESig-QC, AdESeal-QC) only on a valid signature whose certificate is qualified, and qualified on each time-stamp. The Verify Signatures and Sign a Test Document pages show it as a badge (section 15.2).

The EU trusted lists line of the Status page (chapter 14) shows the lists in use.

Trusting the qualified services of the lists

With the same checkbox on, a certificate the list of its country names for a qualified service becomes a trusted certificate for that one verification, as if it were in the Trusted Certificates list (section 11.6):

The service must be qualified at the time that is checked (the time of the signature, of the time-stamp, or now), the list must not be past its next update, and the certificate must be the one the list names (by its public key). The report then shows "anchorSource": "euTrustedList" in trust and the information trusted through … a qualified service in the EU trusted list of RO; the warning that the root is not trusted disappears.

Why it is marked ⚠: the result can differ from a server where the setting is off. Trust never makes a signature valid or invalid by itself, but when a signature does not carry its CA certificate the list completes the chain, and the revocation of the signer can then be checked: a signer revoked before the signature time is then reported invalid. The policy fingerprint changes when the setting changes, so reports made with and without it can be told apart.

It also changes the level: a trusted certificate needs no revocation data in the signature. A PAdES signature whose DSS has no OCSP response for a listed time-stamping authority is reported B-LTA with the setting on (as EU DSS does) and B-T with it off; the report lists such certificates in validationData.notNeeded.

12. Audit Trail

Menu Audit Trail. The server records every administration action, every change of the configuration and of the certificates (also of the Trusted Certificates list), every check and backup, and every error. A verification writes one line with the format, the number of signatures and the status, never the file name or the signer (section 16.12).

Audit Trail page
The Audit Trail.

# 13. Transactions

Menu Transactions (after Configuration). Every signing and verification request that reached the checks of the profile or of the client is one line of the transaction log: when it came, how long it took, the channel (REST API, CSC API, Test for the administration pages, or Self-test for the tests of the Status page), the client and its IP address, the profile, the type (Sign Hash, Sign PAdES, Sign CAdES, Sign XAdES, Sign ASiC-E, Verify, Verify certificate), the size of what was received, the result, the error code and the SHA-256 values of what was received and of what was given back. A CSC request that signs several hashes or documents writes one line for each. A signing request of a known client that is refused before its profile is checked (the server busy, a malformed or interrupted body) has a line too, without profile, size or SHA-256, so every signing request of a client is counted once. Requests refused before the client is known (a wrong API key, a disabled client, an address that is not allowed, the REST API turned off) are only in the Audit Trail (chapter 12).

Transactions page
The Transactions page: a signature and a verification through the REST API, and the daily tests (channel Self-test).

The documents, the digests, the signatures, the file names, the API keys and the PINs are never written. The SHA-256 value lets you answer "was this document signed (or verified) here?" without keeping the document: compute the SHA-256 of the file and search for it.

The Message column says the error code and, in words, the detail: the level made by a signature (and "lowered from…" when a profile allowed a lower level for missing revocation data), the signature algorithm of a hash, the format and the number of signatures of a verification. The common name of the first signer appears only when the setting of section 11.5 asks for it.

14. Status page

Everything that can stop the server from signing, in one place (menu Status).

Status page
The Status page.

Current state, read when the page opens: the license or the trial, the signing certificates (section 7.11), Time stamp servers (each address used by an Active profile: whether it answers, checked at most once a minute without asking for a time stamp; an error when a profile reaches none of its servers, a warning when only its fallback answers), Clock (the clock of the server against the time the time-stamp servers give; an error beyond 5 minutes: set the Windows Time service), the database, the free storage space (warning under 1 GB or under twice the database), the last backup (warning when there is none or when it is older than 30 days), the audit trail and the background work of the server, EU trusted lists (the lists in use, with their number, dates and signature; reading the page downloads nothing; a warning when a list is past its next update or could not be downloaded, section 11.7), and Signature verification: the trusted certificates, the revocation mode and, since the start, the verifications, SERVER_BUSY and VERIFICATION_TIMEOUT answers. It warns (never more: the results of the verification do not depend on it) when the verification is on and no trust anchor is enabled, or when an enabled anchor expires within 30 days or has expired, with a link to the Trusted Certificates page (section 11.6); the main page shows the same warnings. Once an hour the server writes these alerts to the Audit Trail (group Checks), each once: a trust anchor expiring (at 30 and at 7 days), the list without an anchor (once a day), at least 10 SERVER_BUSY answers in an hour (raise the concurrent verifications), at least 20 verifications in an hour with an unknown revocation status or over the time budget (the OCSP or CRL services may be unreachable). The line Alerts counts the alerts of the last 24 hours and names the newest, with a link to the Audit Trail (see Alerts below).

Tests, run by the server every day at the time you set (default 03:00, the time of the server; when the server was not running then and the last run is older than a day, a minute after it starts), and by Run the Tests Now:

The verification has its own test on the Configuration page: Verify a Test Document (section 11.5).

The result is kept and written to the Audit Trail. When something is wrong, or the daily tests did not run, the main page shows a warning with a link to this page.

Setting of this page (with its own Save, written to the Audit Trail): Run the daily tests at (HH:mm, the time of the server).

Alerts. The server keeps its own journal: every alert is a line of the Audit Trail in its database (group Checks and backups; search, export and retention as any audit entry). It writes nothing outside its database for an alert: no Windows Event Log, no registry. Point your monitoring at GET /api/v1/health (section 16.6) and read the Audit Trail, or the line Alerts of this page.

AlertWhenHow often
STATUS_TESTS Failed / Passed with warningsa daily test or Run the Tests Now that did not passeach such run
SIGNING_CERTIFICATE_EXPIRINGthe certificate of an Active profile within 30 days, within 7 days (error), expired (error)once at each
KEY_UNAVAILABLEa signing key cannot be loaded or did not signonce an hour per certificate
TSA_FAILINGa time-stamp server does not answer, or a signature got no time stamponce an hour per server
REVOCATION_UNAVAILABLEthe revocation data of a signing certificate could not be obtained (refused or lower level)once an hour per certificate
DEMO_ENDING, DEMO_LIMIT_REACHED, DEMO_EXPIREDthe trial has 7 days or 500 signatures left / stoppedonce
CLIENT_QUOTA_REACHEDa client used its signing or verification quotaonce per client and quota period
CLIENT_AUTHENTICATION_FAILURESrepeated invalid API keys or CSC loginsthe summaries of the Audit Trail
the four verification alerts aboveas described aboveas above

15. Testing the server

The server tests itself every day and lets you test every part from the administration pages, before a client relies on it. Nothing of these tests is counted by the trial or by a client quota.

15.1 Sign a Test Document

Sign a Test Document (menu Tools → Sign a Test Document, or the button of the same name on a profile's page) signs with any profile, also one that is not Active yet, so a profile can be tried before clients use it. Choose the profile and the file (a PDF for PAdES; one file for CAdES and XAdES — an XML document for an enveloped XAdES signature; one or more files for ASiC-E), then Sign. For a Hash profile type the digest in hexadecimal or Base64 (or select a file: the page computes its digest with the chosen algorithm). The profile's own settings are used, without overrides, with the same size limits as the API. The signed file is verified at once by the same code as Verify Signatures and the page shows one line: green when the signature is valid, by the profile's certificate and at the profile's level; yellow when the level was lowered, the result is "not verifiable" or the verification ran out of time; red when the signing was refused or the result is invalid. Show the full report opens the report, and Download saves the signed file (a Hash profile shows the signature value, with Copy). The signature is real (made with the profile's key) but is not counted by the trial or by any client; each one is written to the Audit Trail (Sign a Test Document page: a document signed) and appears in the Transactions page on the channel Test. Nothing is kept on the server. After the trial the page refuses to sign, like the API (DEMO_EXPIRED).

Sign a Test Document page
Sign a Test Document.

15.2 Verify Signatures

The Verify Signatures page (menu Tools → Verify Signatures, administrator login) does the same verification without a client: select the Signed file and, only for a detached signature, its Original files, then Verify (the button under the files). The result below is a short view of the report of POST /api/v1/verify: a coloured banner with the overall status (green valid, red invalid, amber not verifiable, grey no signature found) and its sentence, the document (name, size, format, validation time), then one card per signature with its status, signer and issuer (by their common name), profile, times, trust, messages and, under Details, the integrity, the signature algorithm, the signing certificate (serial, validity with the time it still had at the validation time, e.g. (21 days), (4 hours) or (expired), key), the certificate chain with the revocation status, the time-stamps and what the signature covers. The fingerprints (SHA-256 of the document and of the certificates), the policy and its fingerprint, the request id, the key usage and the algorithm OIDs are not shown on the page; they are all in the JSON report. The page also leaves out what is normal: "signed data found", an acceptable algorithm, the list of missing validation data (the row Validation data appears only when it is complete), and the warning that a PDF was updated after a signature when the later revisions only add signatures, form filling, validation data or time-stamps (it is shown for annotations and other changes); the trust through an EU trusted list is said in one short sentence. Download Report (JSON) saves exactly the JSON the API answers; Print prints the result with every detail opened.

Downloads of the result. Under the document and in each signature card, buttons save files from the result, only when they are exactly what they say:

ButtonWhenWhat you get
Download the original documenta CMS signature with the document inside (.p7m)the signed document, byte for byte, named as the upload without .p7m (contract.txt.p7m → contract.txt)
Download the document before the first signaturea PDF signed with incremental updatesthe PDF as it was before the first signature
Download revision N (in each signature card)a PDFthe PDF exactly as that signature signed it
Download the XML without signaturesan XML with enveloped signaturesthe XML with the signatures removed (the content that was signed; not always the very same bytes)
Download namean ASiC-E container with one filethat file
Certificate (.cer) (in each signature card)every signaturethe signing certificate alone (DER)

A detached signature (.p7s, a detached XML signature) has no document button: its original is your own file. The files come from the page itself, as the JSON report: the server keeps nothing and is not asked again. For a document above 20 MB the document buttons are left out (a note says so); the certificates stay. The page works even when Verification API enabled is off, is not counted in any quota or in the trial, and writes one transaction-log row without a client. Nothing is kept: leaving the page discards the files and the report.

Verify Signatures page
Verify Signatures.

The eIDAS badge. With Trust the qualified trust services of the EU trusted lists (eIDAS) on (the default) (section 11.7), a dark-blue badge next to the status of a card shows that the EU trusted lists confirm a qualified certificate:

BadgeMeaning
Qualified Electronic Signaturevalid, qualified certificate for electronic signatures, key in a qualified device
Qualified Electronic Sealthe same for electronic seals
Advanced Electronic Signature (Seal) supported by a Qualified Certificateadvanced signature or seal with a qualified certificate (the key is not known to be in a qualified device)
Qualified time-stampa qualified electronic time-stamp (on a document time-stamp, and in the time-stamps table)

The words are those of the EU DSS demo; the JSON report keeps its values (QESig, QESeal, AdESig-QC, AdESeal-QC). In Details → Time-stamps the authority is named by its common name; hold the mouse over it for the whole name.

The badge appears only on a valid signature whose certificate was qualified both when it was issued and at the time of the signature; hold the mouse over it to see the country, the provider and the service of the list. A row eIDAS repeats it in words. A signature that is not valid but has a qualified certificate gets only the row Qualified certificate, without the badge. Details → EU trusted list shows what the list says (status, type, QSCD, the status at the signature time); the list's provider, number and dates are in the badge's title and the JSON. A certificate that is not in the EU trusted lists simply has no badge; when a country's list is still being downloaded, an info message says so and the next verification uses it. Sign a Test Document shows the same badge in its full report.

The row Profile of each signature gives the exact profile and what it means, e.g. PAdES-BASELINE-LTA — PAdES baseline, long-term, with an archive time-stamp, CAdES-XL — CAdES legacy form X-L, PKCS7-T — PDF signature (adbe.pkcs7.detached), not PAdES, with a time-stamp, XML-NOT-ETSI-XMLDSIG — XML signature (XMLDSig), not an ETSI profile. A plain XMLDSig is accepted like any other signature: no warning about its profile.

15.3 The other tests

TestWhereWhat it proves
Test the KeySigning Certificates, the page of a certificateThe account of the server can sign with the key (section 7.5).
Run the Tests NowStatusEvery Active profile signs a test document that the server then verifies; the audit trail and the database are intact; the public address answers (chapter 14). The same tests run every day by themselves.
Verify a Test DocumentConfiguration, Signature VerificationThe verification works with the saved settings (section 11.5).
GET api/v1/healthany HTTP client, without a keyThe server can sign now (section 16.6); for your monitoring.

15.4 From the command line

The same request as a client application, with curl (Windows 10 and later have curl.exe) and the API key of a client that may use the profile:

PowerShell
curl.exe https://sign.example.com/sign/api/v1/health
curl.exe -H "Authorization: Bearer <api-key>" https://sign.example.com/sign/api/v1/profiles

The first answers {"status":"healthy","version":"2.1"}, the second the profiles of the client. A whole signature from PowerShell is in the Quick start; the sample programs of chapter 18 run every endpoint.

# 16. The REST API

Applications sign through the REST API of the server. Its complete reference, with every endpoint, field and error code, is the document REST API (rest-api.md), and the server describes itself at /swagger (the interactive page) and /swagger/docs/v1 (the specification, for code generators). This chapter says what an administrator needs to know: the hash signature (section 16.7), the four document signatures (sections 16.8–16.11), the verification of signatures (section 16.12) and the CSC API (chapter 17).

16.1 Address and key

The API lives under api/v1/ of the address of the server: https://sign.example.com/api/v1/ at the root of a site, https://www.example.com/sign/api/v1/ when the server is an IIS application named sign. Every request except GET /api/v1/health carries the API key of a client (chapter 10):

Text
Authorization: Bearer <the API key>

Use HTTPS: the key and the documents travel in the request.

16.2 What a client must have

A request is signed only when all of these hold, checked in this order; the first that fails gives the answer and nothing is signed:

  1. the REST API is on (server settings);
  2. the key belongs to a client, and the address has not sent too many wrong keys;
  3. the client is enabled, and the address is in its IP allow-list;
  4. the profile exists, is Active, and is one of the client's allowed profiles (otherwise the client is told only that there is no such profile);
  5. the profile is of the type of the endpoint, and the request changes only fields the profile marks Overridable;
  6. the document is not larger than the limit of the profile and of the server;
  7. the client has signatures left in its quotas, and the server is licensed or in its trial;
  8. the certificate of the profile is valid, has the minimum remaining days of the profile, and its key can be used.

A refused request costs nothing: it uses no quota and does not count for the trial.

16.3 Errors

Every error is a JSON answer with a stable code (errorCode, for example QUOTA_EXCEEDED), an explanation, and a request id. The same id is in the X-Request-Id header of every answer and in the Audit Trail, so a client that reports an error with its request id lets you find exactly what happened. The answer never shows why a profile cannot be used, a path, a password or a key; the Audit Trail has the real reason.

16.4 Size of the documents

The maximum document size of the server settings (25 MB by default, at most 100 MB) limits every document; a profile may set a smaller one. Documents travel in Base64, a third larger, so the server accepts requests of about 4/3 of the limit plus 2 MB (36 MB for 25 MB) and refuses larger ones at once, before reading them.

The verification accepts 5 MB more than the maximum document size (30 MB for 25 MB), for the signed document and its original files together, because a signed copy is larger than the document that was signed (the signature, the certificates, the revocation data): a document signed at the limit can always be verified. GET verify/policy gives this value (limits.maxDocumentSize, in bytes). The file Web.config lets IIS accept requests up to 142 MB under api/ (a 105 MB verification in Base64), so that changing the setting never needs a change of that file.

16.5 What is logged

16.6 Health and profiles

16.7 Sign a hash (Hash profiles)

POST /api/v1/sign/hash signs a digest that the application computed itself; the document never reaches the server:

JSON
{ "profile": "seal-hash", "digestAlgorithm": "SHA-256", "digest": "<the digest, Base64>" }

The server signs whatever digest an authorized client sends (the warning of the Hash profile page): give a Hash profile only to applications you trust with the key of the certificate.

16.8 Sign a PDF (PAdES profiles)

POST /api/v1/sign/pades signs a whole PDF document:

JSON
{ "profile": "invoices", "document": "<the PDF, Base64>", "fileName": "invoice-0042.pdf", "overrides": { "reason": "Approved" } }

16.9 Sign any file (CAdES profiles)

POST /api/v1/sign/cades signs any content (a contract, an image, an archive...):

JSON
{ "profile": "contracts-cms", "document": "<the content, Base64>", "fileName": "contract.docx", "overrides": { "detached": true } }

16.10 Sign an XML document or any file (XAdES profiles)

POST /api/v1/sign/xades makes a XAdES signature:

JSON
{ "profile": "efactura", "document": "<the document, Base64>", "fileName": "invoice.xml" }

16.11 Sign several files in one container (ASiC-E profiles)

POST /api/v1/sign/asice puts files of any type in one ASiC-E container (ETSI EN 319 162-1, a ZIP file .asice) with one XAdES signature that covers all of them:

JSON
{
  "profile": "archive",
  "fileName": "dossier",
  "files": [
    { "fileName": "contract.pdf", "document": "<the file, Base64>" },
    { "fileName": "annex.xml", "document": "<the file, Base64>" }
  ]
}

16.12 Verify signatures

POST /api/v1/verify checks every signature of a signed document and answers a report. Only a client allowed to Verify (Allowed operations, section 10.2) may call it; it needs no profile. The settings of the verification and the Trusted Certificates list are in chapter 11. Send the document as JSON ({ "document": "<Base64>", "fileName": "contract.pdf" }) or as a form (multipart/form-data, part document):

PowerShell
curl.exe -H "Authorization: Bearer <api-key>" -F "document=@contract.pdf" https://sign.example.com/api/v1/verify

How to read a report. A short report of a PDF with one signature whose root certificate is not on the server:

JSON
{
  "reportVersion": 1,
  "requestId": "4f1c2a9b7d3e5f60",
  "validationTime": "2026-11-30T10:00:00Z",
  "document": { "fileName": "contract.pdf", "size": 182344, "sha256": "9F86D0…", "format": "pdf" },
  "policy": { "name": "Server verification policy", "fingerprint": "A1B2…", "windowsRootsTrusted": false,
              "revocation": "ocspThenCrl", "trustedCertificateCount": 3 },
  "overall": { "status": "valid", "signatureCount": 1, "valid": 1, "invalid": 0, "notVerifiable": 0,
               "explanation": "The signature is valid.", "errors": [], "warnings": [], "infos": [] },
  "signatures": [ {
    "id": "S-1", "index": 0, "kind": "signature", "format": "pades", "level": "B-T", "status": "valid",
    "errors": [], "warnings": [ { "code": "MSG-UNTRUSTED-ROOT", "text": "…" } ], "infos": [],
    "bestSignatureTime": "2026-11-20T09:00:01Z", "bestSignatureTimeSource": "timestamp",
    "signer": { "subject": "CN=Example Seal,O=Example SRL,C=RO", "…": "…" },
    "trust": { "chainsToTrustedCertificate": false, "status": "untrustedRoot" },
    "qualification": null
  } ]
}
  1. Look at overall.status first: valid (every signature is valid), invalid (at least one is not), notVerifiable (at least one could not be checked, none is invalid) or noSignatureFound. When exactly one signature is not valid, overall.reason repeats its reason.
  2. For each signature, status and, when it is not valid, reason:
    reasonStatusMeaning
    hashMismatch, signatureValueInvalidinvalidthe document or the signature was changed after signing
    revoked, caRevokedinvalidthe signer's (or a CA's) certificate was revoked before the time of the signature
    notYetValidinvalidthe certificate was not yet valid at the time of the signature
    formatFailureinvalidthe signature is damaged or not well formed
    originalMissing, signedDataNotFoundnotVerifiablethe signed document (of a detached signature) or the signed part was not found
    signingCertificateNotFoundnotVerifiablethe signer's certificate is not in the signature
    algorithmNotSupported, integrityNotEstablishednotVerifiablethe server cannot check this signature
  1. errors, warnings and infos hold messages with a stable code (MSG-…) and an English text; a program should test the code, never the text. Warnings never change the status: a root certificate that is not on the server, a certificate expired now, an unknown revocation status, a weak but allowed algorithm. profile names the exact signature profile as the EU DSS validator does: PAdES-BASELINE-LTA, CAdES-BASELINE-T, CAdES-XL (an older long-term form), PKCS7-T (a PDF signature that is not PAdES), XML-NOT-ETSI-XMLDSIG (a plain XML signature), … Its level part is the level the server could confirm.
  2. trust is information only: whether the chain reaches a certificate of the Trusted Certificates list (section 11.6); anchorSource says where the trusted certificate comes from (trustedCertificates, windowsRoots, or euTrustedList with the setting of section 11.7). A signature can be valid with chainsToTrustedCertificate: false; decide in your application whether you accept that signer. validationData.notNeeded lists the certificates that need no revocation data in the signature because they are trusted by this server (or above a trusted one): they do not lower the level, as in EU DSS.
  3. bestSignatureTime is the time the server could prove (from a time-stamp), or the time of the verification; claimedSigningTime is only what the signer wrote.
  4. qualification is the eIDAS qualification according to the EU trusted lists (section 11.7), an extra that never changes the status. mark is QESig (qualified electronic signature), QESeal (qualified electronic seal), AdESig-QC / AdESeal-QC (advanced, with a qualified certificate, key not known to be in a qualified device) or none; the full mark only on a valid signature whose certificate is qualified both when it was issued and at the time of the signature. certificate and trustedListSource say what the list says and which list (country, provider, service, sequence number). qualification is null when it was not looked up: the setting is off, the list of the country could not be had yet (an info MSG-QUALIFICATION-NOT-AVAILABLE says why; the next verification uses the list), or there is no signer certificate. "Not qualified" is never a warning. In a full report each time-stamp has qualified (true, false or null); a document time-stamp has qualification.qualified instead of a mark. signer.declaredQualified only repeats what the certificate says about itself; when the lists do not confirm it, the info MSG-DECLARED-NOT-CONFIRMED says so.
  5. policy.fingerprint identifies the settings and the trusted certificates used: two reports with the same fingerprint were made under the same policy.

GET /api/v1/verify/policy shows what the server checks: the fingerprint of its policy (the same as in each report), the trusted certificates of the list, the revocation and algorithm settings and the limits.

POST /api/v1/verify/certificate with { "certificate": "<Base64 DER or PEM>" } (and optionally "chain": [ ... ], the issuer certificates, which only help to build the chain and are never trusted) tells whether a certificate reaches a trusted certificate of the server now, with the revocation status of each certificate of its chain. A revoked certificate is an error; everything else (not trusted, expired, status unknown) is a warning.

The Verify Signatures page does the same verification without a client (section 15.2).

16.13 The documentation pages

/swagger shows every endpoint with its fields, its error answers and an example of the request and of the answer (Example Value), and lets you try them with a key (type Bearer and the key in the box at the top). A code generator can read /swagger/docs/v1 to make a client library in your language. It holds no secret. If you do not want it public, turn it off in the server settings (section 11.3): the API keeps working.

17. The CSC API

Applications that speak the CSC API v2.0.0.2 (instead of the REST API above) can sign hashes with the profiles of a client. The contract is in docs\csc-api.md.

18. Sample programs in nine languages

The folder ApiSamples of the installation package (RemoteSignatureServer.zip; the Source Edition also has it as ApiSamples.zip in the folder of the server, offered by Download the API Samples on the Configuration page) has two families of small programs, one project per language in each, and every project runs on its own:

FolderAPIAuthenticationWhat the projects show
Rest\<language>REST API api/v1 (chapter 16)the client's API keysigning a digest, a PDF, any content as CMS, an XML document, an ASiC-E container; verifying signatures
Csc\<language>CSC API v2 (chapter 17)the client's name and CSC PINlogging in, the credentials, hashes signed with one authorization (SAD) and checked with the certificate, a PDF, a CMS and an XML signed with signDoc

The languages: C# (.NET 8 and .NET Framework 4.8, one Visual Studio solution per family), PowerShell, Python, JavaScript (Node.js), Java, Go, PHP, Ruby and Bash (curl and OpenSSL). Each project uses only what comes with its language, prints what it sends and what comes back, is commented step by step so you can copy the parts you need, and has a README.txt: what it does, what it needs, how to run it, its parameters, what you see and what to do when something goes wrong. ApiSamples\README.txt lists them all.

18.1 The REST projects

#RequestWhat it shows
1GET healthis the server working (no key)
2GET profilesthe profiles of the client; the sample takes the first one of each type and skips, with a note, the steps of a type the client may not use
3POST sign/hasha signature over the SHA-256 digest of a text computed by the sample (the text never leaves the computer)
4POST sign/padesa one-page PDF made by the sample, signed
5POST sign/cadesa CMS signature of a text file (.p7m or .p7s, as the profile says)
6POST sign/xadesa small XML invoice, signed
7POST sign/asicea container with two files and one signature
8GET verify/policywhat the server checks when it verifies
9POST verify (JSON)the report of the PDF of step 4
10POST verify (multipart)the report of the CMS signature of step 5, uploaded as a file with the file it signed
11an error on purposea text file sent to verify: 400 UNSUPPORTED_FORMAT, and how to read errorCode, detail, requestId

Steps 8–10 need a client allowed to Verify (Allowed operations, section 10.2); for another client they are skipped with a note. The signed files go to an output folder.

18.2 The CSC projects

#RequestWhat it shows
1POST csc/v2/infothe CSC service: name, version, methods, signDoc formats and levels (no login)
2POST csc/v2/auth/loginthe client's name and CSC PIN (HTTP Basic) give an access token, sent as Bearer after
3POST csc/v2/credentials/listthe client's credentials (its profiles), each with its key, certificate and signature algorithms
4POST csc/v2/credentials/authorize, signatures/signHashone SAD bound to the SHA-256 hashes of two texts (one when the profile's multisign is 1, as for hash in the Source Edition), then their signatures, which the sample checks with the credential's certificate (RSA in every language; ECDSA where the language has it built in: C# .NET 8, Java, Go, Ruby, Bash)
5authorize, signatures/signDoc (P)a one-page PDF signed with the PAdES profile, at its level
6authorize, signatures/signDoc (C)a CMS signature of a text file (.p7m or .p7s, as the profile says)
7authorize, signatures/signDoc (X)an XML invoice signed (enveloped, or a detached signature)
8POST csc/v2/auth/revokeends the access token and its SADs

The CSC API signs in two ways: signHash (the program computes the hash, the server signs only the hash, the program puts the signature into its document) and signDoc (the server receives the whole document and returns it signed, as REST does); every signature needs a SAD from credentials/authorize. The signed files go to an output folder; the REST project of the same language can verify them. A step whose credential is not one of the client's is skipped with a note. The CSC API needs HTTPS: on an http:// address a CSC project stops after step 1 (exit code 2); a refused login or a signature that does not verify stop it with an error (exit code 1).

18.3 The SignLib projects: the document stays on your computer

ApiSamples\SignLib\ holds three C# (.NET 8) projects, Pades, Cades and Xades (one solution, PKISimple.SignLibSamples.sln), built on SignLib, the signature library of the same family (https://www.signfiles.com/signature-library/). SignLib builds the signed PDF, CMS (.p7m) or XML on your computer and asks the server only for the signature value: the program computes the SHA-256 hash of what SignLib gives it and sends just those 32 bytes. Each document is signed twice, once through the REST API (POST sign/hash with the API key) and once through the CSC API (credentials/authorize with the hash bound, then signatures/signHash), and both files are verified by SignLib and by the server (POST verify). This is the pattern for documents that must not leave the organization, or for formats the server does not build.

lib\SignLib.dll is the demo version of SignLib: the signed PDFs carry a demo text, and each cryptographic operation takes 10 seconds more. With a licensed SignLib, put its serial number in Common\Settings.cs. The defaults and options are those of the REST and CSC projects (the Hash profile: --hash-profile, default hash).

18.4 Run them

Source Edition: the samples work as is. Without parameters they use the public Source Edition server https://ca.signfiles.com/sign/ and its client api-samples: the REST projects its fixed API key, the CSC projects its fixed CSC PIN and the default profiles hash, pades, cades, xades (public by intent, the same on every Source Edition server). Licensed edition: put your client's key (REST) or its name, CSC PIN and profiles (CSC), on the command line or in the environment:

Option (PowerShell)Environment variableProjectsDefault
--url (-Url)PKISIMPLE_SIGN_URLbothhttps://ca.signfiles.com/sign/
--key (-Key)PKISIMPLE_SIGN_API_KEYRestthe fixed key of the Source Edition
--csc-user (-CscUser)PKISIMPLE_SIGN_CSC_USERCscapi-samples
--csc-pin (-CscPin)PKISIMPLE_SIGN_CSC_PINCscthe fixed PIN of the Source Edition
--hash-credential (-HashCredential)PKISIMPLE_SIGN_CSC_HASHCschash (signHash)
--pades-credential, --cades-credential, --xades-credential (-PadesCredential, ...)PKISIMPLE_SIGN_CSC_PADES, _CADES, _XADESCscpades, cades, xades (signDoc)
—PKISIMPLE_SIGN_INSECURE_TLS=1bothoff: a test server with a self-signed HTTPS certificate is accepted (never in production)
PowerShell
$env:PKISIMPLE_SIGN_URL = "https://sign.example.com/"
$env:PKISIMPLE_SIGN_API_KEY = "<api-key>"
python Rest\Python\pkisimple_rest_sample.py
$env:PKISIMPLE_SIGN_CSC_USER = "<client name>"
$env:PKISIMPLE_SIGN_CSC_PIN = "<PIN>"
python Csc\Python\pkisimple_csc_sample.py

To try every REST step, give the client one profile of each type and tick Verify under Allowed operations; for the CSC steps, turn its CSC access on, set its PIN and allow it a Hash, a PAdES, a CAdES and an XAdES profile (section 10.2). With the test certificates of section 7.9 a report says valid with the warning MSG-UNTRUSTED-ROOT (or MSG-SELF-SIGNED): the signature is intact, and its root is not on the server's Trusted Certificates list (section 11.6).

19. Trial period and registration

Registration page
The Registration page of a server in its trial.

20. Backup, restore, move and upgrade

20.1 Backup and restore

Menu Backup.

Backup and Restore page
The Backup and Restore page.

20.2 Upgrade

To install a newer build: make a backup and copy secret.key, stop the application pool, copy the new files over the old ones (never delete or replace App_Data) and start the pool again (section 3.9). The new build opens the database of the old one when they have the same database version; a database of another version is refused with a message, never changed silently. Version 2.1 is the first version of the product: there is no earlier version to upgrade from.

21. Files and folders

The server keeps all its data in the folder App_Data of the application. IIS and ASP.NET never serve this folder; the server writes nowhere else (no registry, no Windows Event Log, no file in the application folder).

21.1 The application folder

ItemContent
*.aspx, Global.asax, Web.config, bootstrap.*The administration pages and their style.
bin\The program (Remote Signature Server.dll), SignLib, X509Dll and the third-party libraries.
bin\runtimes\win-x64\, bin\runtimes\win-x86\The SQLite engine for a 64-bit and a 32-bit pool.
ApiSamples.zipSource Edition only: the sample programs offered by Download the API Samples.
App_Data\The data of the server (below). Empty in the package.

21.2 App_Data

File or folderContentBack up
App_Data\settings\rss.db (with rss.db-wal and rss.db-shm while the server runs)The database: the configuration, the administrator account, the signing certificates (PFX files and passwords encrypted), the profiles, the clients (only the fingerprints of their keys and PINs), the trusted certificates, the license, the audit trail and the transaction log.yes, through the Backup page (chapter 20)
App_Data\settings\secret.keyThe key of the installation, created at the first start: it encrypts the PFX files and the passwords of the database and makes the fingerprints of the API keys.yes, separately, protected: without it a backup cannot be used
App_Data\settings\rssdemo.sys, signengine.sysThe state of the trial and the counters of the signatures.no
App_Data\settings\startup-error.txtWritten only when the database cannot be opened at a start; the reason. Moved into the audit trail and deleted when the database opens again.no
App_Data\settings\reset-admin.txtCreated by you to reset the administrator account (chapter 6); deleted by the server after the reset.no
App_Data\eutl\The EU trusted lists downloaded for the verification (section 11.7) and their index cache.xml. Public documents; deleted by Delete the Cached Trusted Lists.no (downloaded again when needed)
App_Data\backups\The backups made on the server (Make a Backup on the Server) and the copy before-restore-… saved before a restore.copy them to separate storage

Temporary files (*.tmp) of a backup or of a file being checked live in these folders only while the operation runs. The documents that are signed or verified are never written to the disk.

Warning

Do not copy rss.db while the server runs: the copy may be inconsistent. Use the Backup page, or stop the application pool first and copy rss.db together with secret.key.

21.3 What is not in App_Data

A backup names the certificates whose keys are outside it, so that a restored server can be given the same keys (chapter 20).

# 22. Security recommendations

The recommendations below protect the three things a signing server depends on: its keys, the API keys of its clients and its administration. Most of them are steps of the installation.

22.1 Installation

22.2 HTTPS

22.3 Exposure of the server

AddressWho can use it
api/v1/healthEverybody: it says only healthy or unhealthy.
api/v1/… (the REST API)A client with a valid API key, from an allowed address.
csc/v2/… (the CSC API)Off by default. A client with CSC access, by its name and PIN (chapter 17).
swaggerEverybody, while API documentation (Swagger) enabled is on: it holds no secret, but you may turn it off (section 11.3).
Every other pageLicensed edition: only the administrator, after the login. Source Edition: everybody.

22.4 Keys and certificates

22.5 Clients and API keys

22.6 Backups and the key of the installation

22.7 Personal data

The server stores no document. While a large request is read (over 80 KB), ASP.NET holds it in its folder Temporary ASP.NET Files and deletes it at the end of the request: keep that folder on a protected local disk. The logs hold the names of the client applications, their IP addresses and the SHA-256 values of the documents; the common name of a signer only when Write the first signer's common name to the transaction log is on (section 11.5). Set the retention of the transaction log and delete old audit entries according to your policy (chapter 12, chapter 13).

23. Problems and solutions

The messages below are the texts that PKISimple Remote Signature Server shows on its pages or sends to the client applications. A text in italics inside a message (…) is a part that changes: a path, a number or the text of Windows. Many messages have more details in the Audit Trail (chapter 12), and the Status page (chapter 14) shows in one place everything that can stop the server from signing.

Tip

Start with the Status page and the Audit Trail: the Status page shows what is wrong now, and the Audit Trail records the real reason of every refused or failed request. A client that reports an error with its requestId lets you find the exact entry: search the Audit Trail or the Transactions page for it.

23.1 Installation and start

Problem / messageCauseSolution
An IIS error page, or no page, when you open the address of the applicationASP.NET 4.8 is not enabled in IIS, the application pool is not .NET CLR v4.0 with the Integrated pipeline, or the physical path of the application is wrong.Check the steps of Installation on IIS.
The application cannot write to its data folder (folder):errorGive the application pool account (or the account of the hosting plan) the right to modify this folder.The account of the application pool cannot write in App_Data.Give it the Modify right (section 3.5).
The application runs in partial trust (Medium Trust): the signing keys and the PKCS#11 devices cannot be used. Ask the hosting provider to run the site in Full Trust.A shared hosting runs the site in partial trust.Ask the hosting provider for Full Trust.
The database cannot be opened: … The SQLite engine was not found (path). Copy the bin folder of the server again, with its runtimes subfolder. (also in App_Data\settings\startup-error.txt)The folder bin\runtimes (the SQLite engine e_sqlite3.dll) was not copied.Copy the whole bin folder again, with bin\runtimes\win-x64 and bin\runtimes\win-x86.
The database cannot be opened: … The SQLite engine (path) cannot be loaded: Windows errornumber.Usually Windows blocks the file: the downloaded zip file was marked as blocked, so the files extracted from it are blocked too.Right-click the zip file, Properties, tick Unblock, extract it again and copy the files.
The database is not in WAL mode (journal modemode): the data folder must be on a local disk (not a network share). …The application folder (and App_Data) is on a network share.Move the application to a local disk (chapter 20 describes a move).
The database failed its integrity check when the application started (problem) …The database file rss.db is damaged (disk error, file copied while in use).Restore the last good backup on the Backup page (chapter 20).
The file App_Data\settings\startup-error.txt existsThe database could not be opened at a start; the file holds the reason.Correct the cause. When the database opens again, the server moves the text into the Audit Trail and deletes the file.
The server has a configuration problem. The details are shown when this page is opened on the server itself (http://localhost/...), and in the Audit Trail.The pages show the details of a problem of the server only to a browser on the server itself.Open the page on the server with http://localhost/…, or read the Audit Trail.
The audit trail cannot be written (nevent(s) lost since the start; last error:error).The database cannot be written: a full disk, a lost right, a damaged file.Check the free space and the rights of App_Data\settings, and the Status page.
The server is not installed yet: its administrator must open the administration pages, accept the license agreement and create the administrator account. (to every client)The first start is not complete.Complete it (section 3.7).

23.2 Login and the administrator account

Problem / messageCauseSolution
Too many failed attempts. Try again innseconds.More than 5 wrong passwords from this address or for this user name.Wait (at most 30 seconds), then type the right password.
The password is forgotten—Reset the account with the file reset-admin.txt (chapter 6).
This connection is not encrypted (HTTP): the password is sent in clear text. …The page was opened over HTTP.Use HTTPS (section 3.6).
The session ends by itself30 minutes without activity, or 8 hours after the login.Log in again.

23.3 Signing certificates

The messages of the keys and their solutions are in section 7.7 (Windows store and PFX files) and section 8.3 (PKCS#11 devices). The most common cause is the account of the application pool, which is not allowed to use the key (section 7.6).

23.4 Errors of the REST API

Every error is a JSON answer with errorCode, detail and requestId (section 16.3). The answer says little on purpose; the Audit Trail has the real reason.

HTTP, errorCodeCauseSolution
401 UNAUTHORIZEDNo API key, or a key that belongs to no client (revoked, regenerated, mistyped).Give the application the current key of its client, or generate a new one (section 10.3).
429 TOO_MANY_ATTEMPTSToo many wrong keys from this address: blocked 1 to 15 minutes.Correct the key of the application that sends the wrong one; wait (section 10.5).
403 API_DISABLEDREST API enabled is off.Turn it on (section 11.3).
403 CLIENT_DISABLED, IP_NOT_ALLOWEDThe client is disabled, or the address is not in its IP allow-list.Enable the client or correct its list; behind a proxy, set Trusted reverse proxies (chapter 10).
404 PROFILE_NOT_FOUNDNo such profile, the profile is not Active, or the client may not use it (the client is not told which).The Audit Trail names the real reason: tick the profile under Allowed profiles, or make it Active.
400 PROFILE_TYPE_MISMATCH, OVERRIDE_NOT_ALLOWEDA profile of another type for this endpoint, or a field the profile does not mark Overridable.Use the endpoint of the profile's type; remove the field or mark it Overridable (chapter 9).
400 ALGORITHM_NOT_ALLOWED, DIGEST_LENGTH_MISMATCHA Hash request with a digest algorithm the profile does not accept, or a digest of the wrong length.Section 16.7.
400 INVALID_DOCUMENT, 413 DOCUMENT_TOO_LARGEA document that is not of the profile's kind (not a PDF, damaged, encrypted, a DTD in XML…) or larger than the limit.Sections 16.4–16.11.
429 QUOTA_EXCEEDEDThe client used its quota of the day or of the month.Wait for Retry-After, or raise the quota (section 10.4).
403 DEMO_EXPIREDThe trial ended (45 days or 5,000 signatures).Register the server (chapter 19).
409 CERTIFICATE_NOT_VALIDThe certificate of the profile is expired, not valid yet, below the profile's minimum remaining days, revoked, or outside its Private Key Usage Period.Renew the certificate or choose another one for the profile (section 7.8).
503 KEY_UNAVAILABLEThe key cannot be used now (device disconnected, PIN refused, rights lost).Test the Key on the Signing Certificates page; the Audit Trail has the reason.
502 TIMESTAMP_FAILEDThe time-stamp server and its fallback did not give a valid time stamp.Check the TSA URL and credentials of the profile, the proxy and the Status page.
502 REVOCATION_DATA_UNAVAILABLEB-LT / B-LTA: the OCSP or CRL of the chain could not be fetched.Check the network and the proxy (section 11.2), or tick Allow level T in the profile.
403 OPERATION_NOT_ALLOWEDA verification by a client that may not verify, or with Verification API enabled off.Tick Verify for the client (section 10.2).
400 UNSUPPORTED_FORMAT, DOCUMENT_ENCRYPTED, DOCUMENT_REJECTED_BY_LIMITSThe verification found no format it knows, an encrypted document, or a document over the limits of the verification.Section 16.12.
503 SERVER_BUSY from a signing endpoint (sign/pades, cades, xades, asice, CSC signDoc)Too many document signatures at the same time.Try again after Retry-After; raise Document signatures at the same time (chapter 11) if the server has memory and processors to spare.
Audit warning CLIENT_DISCONNECTEDThe client (or a proxy in between) closed the connection while it was still sending the request, for example a client timeout during a large upload. Not an error of the server; nothing was signed, verified or counted.Look at the client: its timeout, its network, a proxy limit. Many of them at once can mean the server is too slow for large documents (chapter 11).
503 SERVER_BUSY, 504 VERIFICATION_TIMEOUTToo many verifications at the same time, or slow OCSP / CRL services. A busy server answers before it reads the document and counts nothing against the quota or the trial.Try again after Retry-After; raise Verifications at the same time if the server has memory and processors to spare, or the Time budget (section 11.5).

23.5 Verification results

ResultMeaningWhat to do
valid with the warning MSG-UNTRUSTED-ROOTThe signature is intact; its root certificate is not on the Trusted Certificates list.Import the root of the CA if you trust it (section 11.6). Trust never changes the status.
notVerifiable, reason originalMissingA detached signature was sent without the file it signed.Send the original files too.
invalid, reason hashMismatchThe document was changed after signing.Ask the sender for the original.
Every report warns that the revocation was not checkedRevocation checking is None, or Fetch revocation data online is off and the signature carries no validation data.Section 11.5.

24. Glossary

TermMeaning
API keyThe secret of a client application, sent as Authorization: Bearer <key> with every REST API request. Made by the server, shown once (section 10.3).
ASiC-EAssociated Signature Container, Extended (ETSI EN 319 162-1): a ZIP file .asice with several files and a XAdES signature that covers them.
Audit TrailThe journal of the server: administration actions, changes, checks, refused requests and alerts, linked so that a change is detected (chapter 12).
B-B, B-T, B-LT, B-LTAThe levels of the ETSI baseline signatures: basic; with a time stamp; with the validation data (certificates and revocation data); with an archive time stamp.
CAdESCMS Advanced Electronic Signatures (ETSI EN 319 122): a signature of any file, attached (.p7m) or detached (.p7s).
ClientAn application allowed to use the server, with its own API key, profiles, quotas and IP allow-list (chapter 10).
CMSCryptographic Message Syntax (RFC 5652), the format of CAdES signatures.
CRLCertificate Revocation List: the list of the revoked certificates published by a certification authority.
CSC APIThe API of the Cloud Signature Consortium for remote signatures, version 2 (chapter 17).
Detached / attached / envelopedA detached signature is a separate file next to the document; an attached one contains the document; an enveloped XML signature is inside the XML document.
Digest (hash)The fixed-length fingerprint of a document (SHA-256, SHA-384, SHA-512) that a Hash profile signs.
HSMHardware Security Module: a device that keeps private keys and signs with them, reached through PKCS#11.
Key idThe first 8 characters of the fingerprint of an API key; it names the key on the pages and in the logs.
OCSPOnline Certificate Status Protocol (RFC 6960): asks a responder whether a certificate is revoked.
OverridableA field of a profile that a request may change (chapter 9).
PAdESPDF Advanced Electronic Signatures (ETSI EN 319 142): a signature inside a PDF document.
PFX (P12)A PKCS#12 file with a certificate and its private key, protected by a password.
PKCS#11The standard interface of HSMs, smart cards and USB tokens (chapter 8).
ProfileA named recipe of the server: the type of signature, the signing certificate and every setting of the signature (chapter 9).
Public addressThe address of the server that the client applications use (section 11.1).
Request idThe id of a request, in every answer (requestId, X-Request-Id), in the Audit Trail and in the Transactions page.
SADSignature Activation Data: the short-lived authorization of the CSC API for a number of signatures.
secret.keyThe key of the installation, in App_Data\settings: it encrypts the PFX files and passwords and must be kept with the backups (chapter 21).
Signing certificateA certificate with its private key that the server signs with (chapter 7).
Time stamp, TSAA proof from a Time Stamp Authority (RFC 3161) that the signature existed at a time; needed from level B-T.
TransactionsThe log of the signing and verification requests (chapter 13).
Trust anchorA certificate of the Trusted Certificates list that the chain of a signature may reach (section 11.6).
XAdESXML Advanced Electronic Signatures (ETSI EN 319 132).

25.1 Disclaimer

Every effort has been made to make this manual of PKISimple Remote Signature Server 2.1 as complete and accurate as possible, but no warranty or fitness is implied. The information is provided on an "as is" basis. The author shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this manual.

The use of the software is governed by its license agreement, the file License Agreement.txt of the installation package (the licensed edition also shows it at the first start). In case of any difference between this manual and the License Agreement, the License Agreement prevails. In short, and without replacing its text:

Source Edition: the package RemoteSignatureServer-SourceEdition.zip contains the same License Agreement.txt, but the server does not show it at the first start.

25.2 Third-party components

PKISimple Remote Signature Server contains third-party components (among them Bouncy Castle, Pkcs11Interop, Newtonsoft.Json, ASP.NET Web API, Swashbuckle, Bootstrap, Microsoft.Data.Sqlite, SQLitePCLRaw and SQLite), each under its own license. The list, the licenses and the required notices are in the file THIRD-PARTY-NOTICES.txt and in the section OTHER LICENSES of License Agreement.txt.

25.3 Trademarks

.NET, Windows, Windows Server, IIS and PowerShell are trademarks of Microsoft Corporation. Adobe, Acrobat and Reader are trademarks of Adobe Inc. Java is a trademark of Oracle and/or its affiliates. Cloud Signature Consortium is the name of its association. All other trademarks are the property of their respective owners.

25.4 About this manual

PKISimple Remote Signature Server 2.1 · User Manual. The examples use the address https://sign.example.com/sign/, which stands for the address of your server. The names of the menus and windows of Windows and of other programs can differ slightly on your computer.

The pictures of the pages of the server were taken from a test installation of version 2.1 with demonstration data.

Secure Soft SRL, 4 Vasile Conta, Piatra Neamt 610115, Romania · office@signfiles.com · https://signfiles.com/signature-server