Skip to content

Signing documents

With Certilia ePotpis, the users of your service sign documents with a qualified electronic signature or seal them with a qualified electronic seal (eIDAS). Your server prepares the document, the user signs in ePotpis, and your server then embeds the signature in the document.

For the user, signing is always the same. PDF, XML and JSON differ only in how the document is prepared and the signature embedded, so one integration guide covers them, with a tab for each format.

The solution consists of two components:

  • ePotpis – AKD’s signing service. It opens a signing transaction, shows the user the signing page and returns the signature values and the signing certificate to your server.
  • AdES web API – a REST API that calculates the hash to be signed from a document (PreSign, POST) and embeds the signature value in the document (PostSign, PATCH), with a time stamp if needed. It has three parts, one for each format: PAdES for PDF, XAdES for XML and JAdES for JSON.

ePotpis receives only the hash of the document, not the document itself. You send the document only to the AdES web API.

Signature (sign) Seal (seal)
Signer a natural person, for private or business purposes a responsible person on behalf of a legal person
Certificate holds natural person data (a business certificate also organisation data) legal person data
Data for the visual personNaturalData (required), personLegalData (business signature) personLegalData (required)

You choose the type with the signatureType field: in ePotpis, where it decides which certificates the user sees, and in the AdES web API.

PDF (PAdES) XML (XAdES) JSON (JAdES)
API address (test) https://api.test.certilia.com/pades/v2 https://api.test.certilia.com/xades/v1 https://api.test.certilia.com/jades/v1
mimetype in ePotpis pdf xml json
The prepared file is kept for 24 hours 20 minutes 20 minutes
timeStamp in PostSign no required required
Signature data in the document a visible visual an XML comment in the signature element the hr block in the unsigned header etsiU
API prefix in the error code 6 7 B
Signed document PDF XML with an enveloped signature a JWS in the JSON serialization

The signature levels (B, T, LT and LTA) are the same for all three formats: see Signature levels and time stamps.

  • Token – a one-time, unique identifier of the signing transaction (a JWT). ePotpis issues it, and you send it in every call of the same transaction. A transaction can hold one or more documents.
  • Verification code – a unique code (UUID) of one document in the transaction. It is embedded in the signature data; if there is a visual, it is printed on it and contained in the QR code.
  1. Signing service. You order the service in the Certilia Developer portal (Signing → New signing service). A free trial package is available to start with. When ordering, you enter:

    • the name of the service provider, the name of the service and the type of documents your users sign,
    • the base URL of the service and the URL to which ePotpis sends the signed data (step 5 of the guide),
    • the URLs to which ePotpis redirects the user after a successful signature and after an error,
    • (optional) the URL where you keep signed documents for verification.

    The portal assigns your service the identifiers systemId, serviceId and documentId.

  2. Signing API key. You create the key on the signing service’s page, on the Integration tab. The same key is valid for the PAdES, XAdES and JAdES web APIs. Send it in the Authorization: Bearer <signing API key> header. The key remains available there under Show key; creating a new key immediately invalidates the current one.

  3. Network.

    • Your servers must have access to ePotpis and the AdES web API over TLS 1.2 or 1.3 (addresses in the table below).
    • Your URL for the signed data must be reachable by ePotpis over HTTPS, with a valid server certificate.
    • Your users’ computers must have access to AKD’s certificate status services (CRL, OCSP). Their addresses are written in the certificates themselves.
  4. User certificates. The user signs with the Croatian ID card (eOI), a Certilia card, a FINA certificate on a USB device or a Certilia remote certificate (in the cloud). To sign with a card or a USB device on a computer, the user needs the latest middleware of its issuer, for example eID Middleware (eid.hr) for the ID card and Certilia Middleware (certilia.com) for the Certilia card.

  5. Time stamp. For levels T, LT and LTA you need your own time stamp service (see Signature levels and time stamps).

Service Test Production
ePotpis API https://esign.test.certilia.com/api/v2/epotpis https://esign.certilia.com/api/v2/epotpis
ePotpis, signing page https://esign.test.certilia.com/epotpis/ https://esign.certilia.com/epotpis/
PAdES web API https://api.test.certilia.com/pades/v2 https://api.certilia.com/pades/v2
XAdES web API https://api.test.certilia.com/xades/v1 https://api.certilia.com/xades/v1
JAdES web API https://api.test.certilia.com/jades/v1 https://api.certilia.com/jades/v1
TSA (for tsaAccess.url) https://tsa.test.certilia.com/qts https://tsa.certilia.com/qts