Preskoči na sadržaj

Embed signature value (PostSign)

PATCH
/jades/v1
curl --request PATCH \
--url https://api.test.certilia.com/jades/v1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "token": "<token from ePotpis>", "signatureFormat": "jades", "signatureLevel": "lta", "userCertificate": "<userCertificate from ePotpis>", "tsaAccess": { "url": "https://tsa.test.certilia.com/qts", "username": "<TSA username>", "password": "<TSA password>" }, "documents": [ { "verificationCode": "00000000-0000-0000-0000-000000000001", "hash": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "signedHash": "<signedHash from ePotpis>", "timeStamp": "<timeStamp from ePotpis>" } ] }'

Embeds the signature value created in ePotpis in the prepared (presign) file and returns the signed document.

  • Uses the eIDAS JAdES standard.
  • Time stamping is optional. Available eIDAS levels: T, LT and LTA.
  • One request can hold one or more signature values, each for its prepared file.
  • The API finds the stored prepared file and embeds the signature value. The prepared file is deleted after this call, whatever the result.
Media typeapplication/json

PostSign request. Holds the signature values to embed and the time-stamp settings.

object
token
required

EPotpis transaction token, the same as in PreSign.

string
>= 1 characters
signatureFormat
required

Signature format, the same as in PreSign.

string
>= 1 characters
signatureLevel
required

EIDAS signature level: b (B-B), t (B-T), lt (B-LT) or lta (B-LTA). Time stamping is optional; t, lt and lta add a time stamp and need tsaAccess.

string
>= 1 characters
userCertificate
required

The signer’s X.509 certificate in hexadecimal, unchanged as received from ePotpis with the signed data (signingData.userCertificate). A certificate in Base64 fails with POSTSIGN_BUILD_ERROR.

string
>= 1 characters
tsaAccess

Access data for the AKD time-stamping service (TSA).

AKD issues the access data on request; the request form is on certilia.com.

object
url

TSA URL:

  • Test: https://tsa.test.certilia.com/qts
  • Production: https://tsa.certilia.com/qts
string
nullable
username

TSA username.

string
nullable
password

TSA password.

string
nullable
documents
required

One entry per signature value to embed.

Array<object>

One signature value and the document it belongs to.

object
verificationCode
required

Verification code, the same as in PreSign.

string
>= 1 characters
hash
required

The hash that PreSign returned for this document.

string
>= 1 characters
signedHash
required

The signature value for this hash, as received from ePotpis (signedHash).

string
>= 1 characters
timeStamp

The signing time ePotpis sent with the signed data for this document (timeStamp), unchanged: a UTC date and time as hex-encoded ASCII text (323032362D31312D31335432333A34323A34305A is 2026-11-13T23:42:40Z). The API writes it into the signature as the signing time.

string
nullable

Example

{
"token": "<token from ePotpis>",
"signatureFormat": "jades",
"signatureLevel": "lta",
"userCertificate": "<userCertificate from ePotpis>",
"tsaAccess": {
"url": "https://tsa.test.certilia.com/qts",
"username": "<TSA username>",
"password": "<TSA password>"
},
"documents": [
{
"verificationCode": "00000000-0000-0000-0000-000000000001",
"hash": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
"signedHash": "<signedHash from ePotpis>",
"timeStamp": "<timeStamp from ePotpis>"
}
]
}

The signed document(s).

Media typeapplication/json

PostSign response.

object
token
required

EPotpis transaction token, the same as in the request.

string
>= 1 characters
documents
required

One entry per signed document.

Array<object>

One signed document.

object
verificationCode
required

Verification code, the same as in the request.

string
>= 1 characters
documentName

Document name, as sent in PreSign, for display to the user.

string
nullable
base64Document
required

The signed document, Base64-encoded: a JWS in the JSON serialization (payload holds your JSON document, signatures the signature with the signer’s certificate).

string
>= 1 characters
mimeType
required

Document type, json.

string
>= 1 characters

Example

{
"token": "<token from ePotpis>",
"documents": [
{
"verificationCode": "00000000-0000-0000-0000-000000000001",
"documentName": "Order 2026-0001.json",
"mimeType": "json"
}
]
}

The request contains invalid values, or another error occurred during PostSign. All error codes are listed by GET /jades/errors. POSTSIGN_BUILD_ERROR means the signature could not be embedded, for example because the prepared file has expired or userCertificate is not in hexadecimal.

Media typeapplication/json

Error response.

object
error

Error details.

object
traceId

Trace identifier. Send it to support when you report a problem.

string
nullable
type

Error type, the group the error belongs to.

string
nullable
code

Error code. Structure: the first character identifies the API (B for JAdES), the remaining characters are the error number. Example: B111 is error 111 of the JAdES web API.

string
nullable
status

HTTP status code.

integer format: int32
message

Public error name.

string
nullable
description

Localised error description, in Croatian or English. The language is set on the server; the default is Croatian (HR).

string
nullable
info

Additional information about the error.

string
nullable
language

Language of description.

string
nullable
name

Public error name, the same as message (kept for compatibility).

string
nullable

Example

{
"error": {
"type": "HG_GENERAL_ERROR",
"code": "B111",
"message": "POSTSIGN_BUILD_ERROR",
"description": "PostSign error."
}
}