You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

Introduction


The REST interface offered by SWS is exposed at the path:

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


Descriptionreturn the certifcate associated to "device_signer"
HttpMethodPOST
Path
/rest/enquiry/certificate
Request
{
  "credentials": {
    "username""device_signer"
  }
}
Responsereturn the byte array of certificate associated to device_signer

ENQUIRY: signatures


Descriptionreturn the numer of signatures apposed from "device_signer"
HttpMethodPOST
Path
/rest/enquiry/signatures
Request
{
  "credentials": {
    "username""device_signer"
  }
}
ResponseNumber of signatures apposed


ENQUIRY: signatures-available


Descriptionreturn the number of signatures which "device_signer" can apply
HttpMethodPOST
Path
/rest/enquiry/signatures-available
Request
{
  "credentials": {
    "username""device_signer"
  }
}
ResponseNumber of signatures available

ENQUIRY: otps


Descriptionreturn the otp list associated to "device_signer"
HttpMethodPOST
Path
/rest/enquiry/otps
Request
{
  "credentials": {
    "username""device_signer"
  }
}
Response

[
    {
        "idOtp": number,
        "serialNumber""string",
        "type""otp-type-enum"
    },
   {
        "idOtp": number,
        "serialNumber""string",
        "type""otp-type-enum"
    }

]


ENQUIRY: timestamps-available


Descriptionreturn the numeber of timestamp available (valid only for Namirial TSA account)
HttpMethodPOST
Path
/rest/enquiry/timestamps-available
Request

{
  "timestampUrl""timestamp-namirial-enquiry-url",
  "timestampUsername""tsa-username",
  "timestampPassword""tsa-password"
}

ResponseNumber of timestamps available

ENQUIRY: errors


Descriptionreturn the error description associated to error code
HttpMethodPOST
Path
/rest/enquiry/errors
Request

{
  "error_code": integer,
  "lang""COUNTRY-CODE-2DIGIT"
}

Response

[
    {
        "errorCode"integer,
        "errorLanguage""CONUNTRY-CODE-2DIGIT",
        "errorLanguage2""COUNTRY-CODE-3DIGIT",
        "errorText""Description error in language"
    }
]

Admin

ADMIN: remove-certificate-from-cache


Descriptionremove the certificate from cache of SWS
HttpMethodPUT
Path
/rest/admin/remove-certificate-from-cache
Request

{
  "error_code"integer,
  "lang""COUNTRY-CODE-2DIGIT"
}

Response

Timestamps

TIMESTAMPS: apply

Descriptionpermits to apply timestamp on specified file
HttpMethodPOST
Path
/rest/timestamps/apply
Request
timeStampPreferences

{
  "filenameInTSD": "string",
  "outputAsPDF": true,
  "outputAsTSD": true,
  "outputBase64Encoded": true,
  "timestampHashAlgo": "string",
  "timestampPassword": "string",
  "timestampUrl": "string",
  "timestampUsername": "string"
}

contentfile to apply timestamp


Response

User

USER: change-password

Descriptionpermits to change the password associated to device signer
HttpMethodPOST
Path
/rest/user/change-password
Request (for remote device signer)

{
  "credentials": {
    "idOtp": idOtp or -1,
    "otp""otpCode",
    "password""old-password-of-device-signer-remote",
    "username""device-signer-remote"
  },
  "newPassword""new-password-of-device-signer-remote"
}

Request (for automatic device signer)

{
  "credentials": {
    "securityCode": "securityCode associate to automatic device signer",
    "password""old-password-of-device-signer-automatic",
    "username""device-signer-automatic"
  },
  "newPassword""new-password-of-device-signer-automatic"
}

ResponsePassword update succesfully

Sign

SIGN: openSession


Descriptionpermits to open the sessione for apply multiple sign with remote device
HttpMethodPOST
Path
/rest/sign/openSession
Request

{
  "credentials": {
    "idOtp"-1,
    "otp""775351",
    "password""12345678",
    "username""RHIP22021116852552"
  }
}

ResponseString with the session

SIGN: getRemainingTimeForSession


Descriptionpermits to obtain the time until the session is valid
HttpMethodPOST
Path
/rest/sign/getRemainingTimeForSession
Request

{
  "credentials": {
    "sessionKey""zZto1G0DpL/vBFkTnK7caquzY5pasOlzS+bQG7wUkOONnbV7Vhd+JSPTjP7ZqTYR12QjS0W89T7UmnQB2KzAQ3C4NalDgFE67ntqoGm7uOU7+oOPLvKQv/p5aeZ2bcjKe6x5KQPUEH//rKaExFcLcLj8cnwXfFBixJ4MN+3o8S5535HcRxWv+YoTHHgAY16Fh0yJGfLL3x/4W+HJeiIYL2cHpKNTGkKcGTM8Eon0R+djNFvKzZSF1VIETPADqDdvgLYkRWODd3yoUvExGk5BcQKVm0Z7Nd7NMKl4NRbHumdqmqy81jchQv2qlXIxSpjZ0GTnL4vDZMF2MP2DGHPoWw==",
    "username""RHIP22021116852552"
  }
}

ResponseSeconds until the session is valid

SIGN: closeSession


Descriptionpermits to destroy the session before will expire
HttpMethodPOST
Path
/rest/sign/closeSession
Request

{
  "credentials": {
    "sessionKey""zZto1G0DpL/vBFkTnK7caquzY5pasOlzS+bQG7wUkOONnbV7Vhd+JSPTjP7ZqTYR12QjS0W89T7UmnQB2KzAQ3C4NalDgFE67ntqoGm7uOU7+oOPLvKQv/p5aeZ2bcjKe6x5KQPUEH//rKaExFcLcLj8cnwXfFBixJ4MN+3o8S5535HcRxWv+YoTHHgAY16Fh0yJGfLL3x/4W+HJeiIYL2cHpKNTGkKcGTM8Eon0R+djNFvKzZSF1VIETPADqDdvgLYkRWODd3yoUvExGk5BcQKVm0Z7Nd7NMKl4NRbHumdqmqy81jchQv2qlXIxSpjZ0GTnL4vDZMF2MP2DGHPoWw==",
    "username""RHIP22021116852552"
  }
}

Response
  • No labels