Preskoči na sadržaj

Embed signature value (PostSign)

PATCH
/xades/v1
curl --request PATCH \
--url https://api.test.certilia.com/xades/v1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "token": "<token from ePotpis>", "signatureFormat": "xades", "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 XML document and returns the signed XML document.

  • One request can hold one or more signature values, each for its document, identified by the verificationCode of the ePotpis transaction.
  • Every document needs timeStamp: the one ePotpis sent with the signed data.
  • Call it right after ePotpis has sent the signed data: the prepared document is kept for 20 minutes after PreSign.
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, xades, the same as in PreSign.

string
>= 1 characters
signatureLevel
required

Signature level: b (B-B), t (B-T), lt (B-LT) or lta (B-LTA). 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).

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

Mandatory. 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 SigningTime.

string
nullable

Example

{
"token": "<token from ePotpis>",
"signatureFormat": "xades",
"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 XML 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
base64Document
required

The signed XML document, Base64-encoded. The signature (enveloped) is inside the root element.

string
>= 1 characters
mimeType

Document type, xml.

string
nullable

Example

{
"token": "<token from ePotpis>",
"documents": [
{
"verificationCode": "00000000-0000-0000-0000-000000000001",
"base64Document": "PD94bWwgdmVyc2lvbj0iMS4wIj8+...",
"mimeType": "xml"
}
]
}

The request contains invalid values, or another error occurred during PostSign. POSTSIGN_BUILD_ERROR means the signature could not be embedded, for example because the prepared document has expired or userCertificate is not in hexadecimal.

Media typeapplication/json

Error response.

object
error

Error details.

object
type

Error type, the group the error belongs to.

string
code

Error code. The first character identifies the API (7 for XAdES), the rest is the error number.

string
message

Public error name. Rely on code or message in your code, not on description.

string
description

Error description.

string

Example

{
"error": {
"type": "HG_GENERAL_ERROR",
"code": "7111",
"message": "POSTSIGN_BUILD_ERROR",
"description": "Postsign error."
}
}