Skip to content

Sign

Signature function

Operations

Sign: signature function

Request

This function allows user to sign a document in any of the supported signature format.

The document to sign can be sent through an URL (parameter url_in) or through data stream (parameter file_in); only one of the above methods can be used.

The signed file is sent to an URL (parameter url_out) or it can be retrieved through the result endpoint (for 60 seconds, see above).

URL: http://{SMARTSEC}/api/sign METHOD: POST ENCODING: multipart/form-data

Bodymultipart/form-datarequired
One of:

Input parameters for /api/sign (multipart/form-data).

Note: the document to sign can be provided either with url_in OR with file_in (only one method can be used).

url_instring

URL with document to sign

url_outstring

URL where the signed document is posted

urlbackstring

URL to which the response is sent

file_instring, (binary)

Document data stream to sign

usernamestring

Username for the remote identity

passwordstring

Password for the remote identity

pinstring

PIN for the remote identity

otpstring

OTP for the remote identity

checkstring

1 : the certificate will be checked before signature 0 : the certificate will NOT be checked before signature

formatstring

pades, cades, xades (lower case). Default is pades

identifierstring

Token identifier

tsa_bookmarkstring

The alias corresponding to the Timestamp authority to use. The binding between alias and the Timestamping resource is managed by SignBox configuration.

target_expstring

XPath expression to sign selected nodes instead of the root node (default expression is '/*'). If this expression selects a XAdES signature node, it countersigns it.

reasonstring

The PAdES attribute for the reason

locationstring

The PAdES attribute for the location

levelstring

T, X, XL, BES, LTV

img_bookmarkstring

Bookmark for graphic signature placement (image + position). Example bookmarks: dn01, dn02, dn03, dn04.

Aliases onlydn01, onlydn02, onlydn03, onlydn04 print only the Subject DN. If img_bookmark is set, the position parameter is discarded.

npagestring

Page where the graphic signature is inserted. First page is 0. Default value is 0.

curl -i -X POST \
  http://example.com/api/sign \
  -H 'Content-Type: multipart/form-data' \
  -F url_in=string \
  -F url_out=string \
  -F urlback=string \
  -F 'file_in=@file_in.bin;type=application/octet-stream' \
  -F username=string \
  -F password=string \
  -F pin=string \
  -F otp=string \
  -F check=string \
  -F format=string \
  -F identifier=string \
  -F tsa_bookmark=string \
  -F target_exp=string \
  -F reason=string \
  -F location=string \
  -F level=string \
  -F img_bookmark=string \
  -F npage=string

Responses

Output Parameters

Bodyapplication/json
idstring

Job ID assigned to the call (example 3.3)

messagestring

String with the error detail

exceptionstring

Exception related to the error

Response
{ "id": "3.3" }