Introduction
SWS provides REST interface for Pades and Cades signatures for very large files (you can sign files over 1GB). Without any problem with appliance memory as it handles files with a stream.
At this link:
http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/service
You can find this two method:
- signPAdES
- signCAdES
signPAdES
Below is the example of signPAdES request with CURL:
curl --form 'credentials="{\"username\":\"DEVICENAME\",\"password\":\"PASSWORD\"}";type=application/json' --form 'preferences="{\"page\":\"1\",\"hashAlgorithm\":\"SHA256\", \"withTimestamp\": \"false\"}";type=application/json' --form file=@FILE_TO_BE_SIGNED.pdf --request POST http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/service/signPAdES --output FILE_SIGNED.pdf
In this example, we are signing the file: "FILE_TO_BE_SIGNED.pdf" and the file signed will be saved in "FILE_SIGNED.pdf".
signCAdES
Below is the example of signCAdES with CURL:
curl -X POST http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/service/signCAdES --form "credentials=@credentials.json;type=application/json" --form "preferences=@cadesPreferences.json;type=application/json" --form file="@File_to_sign.pdf" -o "File_signed.pdf.p7m"
In this example, we are signing the file: "File_to_sign.pdf" and the file signed will be saved in "File_signed.pdf.p7m"
At this link, you can download the preferences and the credentials used.