Table of Contents |
---|
Introduction
The REST interface offered by SWS is exposed at the path:
Code Block |
---|
http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/ |
This path is composed by other sub-path for every of purpose:
- admin: method for sws like remove certificate from cache
- enquiry: contain the method for obtain the information like signatures available, signer certificate, timestamps available ecc...
- sign: this is the principal path of SWS and contain the methods for apply the signature
- timestamps: methods for apply the timestamp on every type of file
And in this guid will be described how manage the error generated by the REST interface.
Enquiry
ENQUIRY: certificate
Table of Contents |
---|
Introduction
The REST interface offered by SWS is exposed at the path:
Code Block |
---|
http://<IP-APPLIANCE>:8080/SignEngineWeb/rest/ |
This path is composed by other sub-path for every of purpose:
- admin: method for sws like remove certificate from cache
- enquiry: contain the method for obtain the information like signatures available, signer certificate, timestamps available ecc...
- sign: this is the principal path of SWS and contain the methods for apply the signature
- timestamps: methods for apply the timestamp on every type of file
And in this guid will be described how manage the error generated by the REST interface.
Enquiry
ENQUIRY: certificate
Description | return the certifcate associated to "device_signer" | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/enquiry/certificate | |||||
Request |
| |||||
Response | return the byte array of certificate associated to device_signer |
ENQUIRY: signatures
Description | return the numer of signatures apposed from "device_signer" | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/enquiry/signatures | |||||
Request |
| |||||
Response | Number of signatures apposed |
ENQUIRY: signatures-available
Description | return the number of signatures which "device_signer" can apply | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/enquiry/signatures-available | |||||
Request |
| |||||
Response | Number of signatures available |
ENQUIRY: otps
Description | return the otp list associated to "device_signer" | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/enquiry/certificateotps | |||||
Request |
| |||||
Response | return the byte array of certificate associated to device_signer |
ENQUIRY: signatures
/rest/enquiry/signatures
Expand | ||
---|---|---|
| ||
{ "credentials": { "username": "device_signer" } } |
|
ENQUIRY: timestamps-available
Description | return the number of signatures which "device_signer" can applynumeber of timestamp available (valid only for Namirial TSA account) | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/enquiry/signaturestimestamps-available | |||||
Request |
| |||||
Response | Number of signatures timestamps available |
ENQUIRY:
otpserrors
Description | return the otp list associated to "device_signer" | ||||||||||||
HttpMethod | POST | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | /rest/enquiry/otps | ||||||||||||
Requesterror description associated to error code | |||||||||||||
HttpMethod | POST | ||||||||||||
Path | /rest/enquiry/errors | ||||||||||||
Request |
| ||||||||||||
Response | Description | return the numeber of timestamp available (valid only for Namirial TSA account)
| Response |
Expand | ||
---|---|---|
| ||
[ |
ENQUIRY: timestamps-available
|
Admin
ADMIN: remove-certificate-from-cache
Description | remove the certificate from cache of SWS | |||||
HttpMethod | PUT | |||||
---|---|---|---|---|---|---|
Path | /rest/admin/remove-certificate-from-cache | |||||
Request |
| |||||
Response |
Timestamps
TIMESTAMPS: apply
Description | permits to apply timestamp on specified file | ||||||
HttpMethod | POST | ||||||
---|---|---|---|---|---|---|---|
Path | /rest/enquirytimestamps/timestamps-availableapply | ||||||
Request | |||||||
timeStampPreferences | Description | return the error description associated to error code
| |||||
Response | Number of timestamps available |
ENQUIRY: errors
| |
content | file to apply timestamp |
Response |
User
USER: change-password
Description | permits to change the password associated to device signer | ||||||||||||
HttpMethod | POST | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | /rest/enquiry/errors | Request |
Expand | ||
---|---|---|
| ||
{ |
Expand | ||
---|---|---|
| ||
[ |
Admin
ADMIN: remove-certificate-from-cache
Description | remove the certificate from cache of SWS | |||||
HttpMethod | PUT | |||||
---|---|---|---|---|---|---|
Path | /rest/admin/remove-certificate-from-cacheuser/change-password | |||||
Request (for remote device signer) |
| |||||
Request (for automatic device signer) |
| |||||
Response | Password update succesfully |
Sign
SIGN: openSession
Description | permits to open the sessione for apply multiple sign with remote device |
HttpMethod | POST |
---|---|
Path | /rest/sign/openSession |
Request |
TIMESTAMPS: apply
Description | permits to apply timestamp on specified file
| Response |
Timestamps
| |||
Response | String with the session |
SIGN: getRemainingTimeForSession
USER: change-password
Description | permits to obtain the time until the session is valid | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/timestampssign/applygetRemainingTimeForSession | |||||
Request | timeStampPreferences |
Expand | ||
---|---|---|
| ||
{ |
User
Description | permits to change the password associated to device signer
| |||||
Response | Seconds until the session is valid |
SIGN: closeSession
Description | permits to destroy the session before will expire | ||||||||
HttpMethod | POST | ||||||||
---|---|---|---|---|---|---|---|---|---|
Path | /rest/usersign/change-passwordcloseSession | ||||||||
Request (for remote device signer) |
| ||||||||
Response |
SIGN: sendOtpBySMS
Description | permits to destroy the session before will expire | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/sign/sendOtpBySMS | |||||
Request |
| |||||
Response | Password update succesfully |
Sign
SIGN:
openSessionsignCades
Description | permits to open the sessione for apply multiple sign with remote deviceapply the cades signature | ||||
HttpMethod | POST | ||||
---|---|---|---|---|---|
Path | /rest/sign/openSessionsignCades | ||||
Request | |||||
Description | permits to obtain the time until the session is valid | ||||
HttpMethod | POST | ||||
Path | /rest/sign/getRemainingTimeForSession | ||||
credentials | |||||
Request
| |||||
Response | String with the session |
SIGN: getRemainingTimeForSession
| |
cadesPreferences |
SIGN: sendOtpBySMS
Description | permits to destroy the session before will expire
| |||||
Response | Seconds until the session is valid |
SIGN: closeSession
/rest/sign/closeSession
Expand | ||
---|---|---|
| ||
{ |
| |
content | file to sign |
Response | byte array of signed files |
SIGN: signPades
Description | permits to apply the pades signature | ||||||
HttpMethod | POST | ||||||
---|---|---|---|---|---|---|---|
Path | /rest/sign/sendOtpBySMSsignPades | ||||||
Request | |||||||
credentials | |||||||
Description | permits to apply the cades signature | ||||||
HttpMethod | POST | ||||||
Path | /rest/sign/signCades | ||||||
Request | credentials
| Response |
SIGN: signCades
| |||||||||||||
padesPreferences |
| cadesPreferences |
| ||||||||||
content | file to sign | ||||||||||||
Response | byte array of signed files |
SIGN: signPades
Description | permits to apply the pades signature | ||||||||||||
HttpMethod | POST | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Path | /rest/sign/signPades | ||||||||||||
Request | credentials |
Expand | ||
---|---|---|
| ||
{ "username":"device signer name", "password":"PIN of device signer name", "idOtp":associated to device signer or -1, "otp":"otp code", "sessionKey":"string with sessionKey" } |
Expand | ||
---|---|---|
| ||
{ "height":int, |
SIGN: signXades
Description | permits to apply the pades signature | |||||
HttpMethod | POST | |||||
---|---|---|---|---|---|---|
Path | /rest/sign/signXades | |||||
Request | ||||||
credentials |
| |||||
xadesPreferences |
| |||||
content | XML file to sign | |||||
Response | byte array of signed files |
...