Websocket Interface
The PadConnector assumes that requests over the web socket are JSON objects.
The requests contain a "messageId" field.
The requests contain a "type" field.
The requests may contain a "data" field whose structure varies for different message types.
Replies are JSON objects.
Replies may contain a "messageId" field.
Replies may contain a "data" field.
The messageId may be a field of the "data" field.
Lazy replies are replies that may be sent in the future.
Lazy replies contain a "type" field.
Lazy replies contain a "data" field that has a "messageId" field and a sequence of fields with keys "value[0-9]+".
Types
- 1 executeDeviceSearch
- 2 finishSigning
- 3 getBioData
- 4 getButtonConfigs
- 5 getButtonEvents
- 6 getDevice
- 7 getDeviceCertificate
- 8 getDeviceCount
- 9 getDeviceInfo
- 10 getDeviceOpened
- 11 getDeviceSerial
- 12 getEncryptedAesKey
- 13 getNotaryInfo
- 14 getPreliminaryData
- 15 getSignatureImage
- 16 getSignedFinalDocHash
- 17 getVersion
- 18 keepAlive
- 19 onStaticAppletGetImage
- 20 setButtonConfigs
- 21 setFinalDocHash
- 22 start
- 23 startSigning
- 24 startViewing
- 25 stopSigning
Requests, replies, lazy replies.
executeDeviceSearch
searches devices and selects one of them.
The reply contains "data" with "ret" with a one(1) in case of success.
finishSigning
ends a running signature capture in a similar way as the OK click on the device.
This should lead to a lazy "onStaticAppletSignatureFinished" reply.
getBioData
gets biodata.
The reply contains "data" that contains a "ret" field with the biodata as a base64-encoded sequence of naturaSignV2 records.
getButtonConfigs
gets the current button configuration of the signature pad. Since v2.2.0
The reply contais "data" with "ret" with an array of button configs.
An element of that array, a single button config, has the fields
mode being one of Signature or DocView or DocSign
kind being one of Ok, Repeat, Cancel, Rotate, Rotate90, Prev, Next, ZoomIn, ZoomOut, StartSignature
visible, boolean
enabled, boolean
color which is a 32bit ARGB value.
{"data":{"messageId":"ceec4053-a1f3-4a6f-996d-a4b3e975cd83"},"type":"getButtonConfigs"}
{"data":{"ret":[
{"mode":"Signature", "visible":true, "color":-16776961, "kind":"Rotate", "enabled":true},
{"mode":"Signature", "visible":false, "color":-16776961, "kind":"Rotate90", "enabled":false},
{"mode":"Signature", "visible":false, "color":-16711936, "kind":"Next", "enabled":false},
{"mode":"Signature", "visible":false, "color":-16711936, "kind":"Prev", "enabled":false},
{"mode":"Signature", "visible":true, "color":-16711936, "kind":"Ok", "enabled":true},
{"mode":"Signature", "visible":true, "color":-8372224, "kind":"Repeat", "enabled":true},
{"mode":"Signature", "visible":true, "color":-16711936, "kind":"Cancel", "enabled":true},
{"mode":"DocView", "visible":true, "color":-16776961, "kind":"Rotate", "enabled":true},
{"mode":"DocView", "visible":true, "color":-16776961, "kind":"Rotate90", "enabled":true},
{"mode":"DocView", "visible":true, "color":-65536, "kind":"Next", "enabled":true},
{"mode":"DocView", "visible":true, "color":-16776961, "kind":"Prev", "enabled":false},
{"mode":"DocView", "visible":true, "color":-16776961, "kind":"ZoomIn", "enabled":true},
{"mode":"DocView", "visible":true, "color":-16776961, "kind":"ZoomOut", "enabled":true},
{"mode":"DocView", "visible":true, "color":-65536, "kind":"StartSignature", "enabled":true},
{"mode":"DocSign", "visible":true, "color":-16776961, "kind":"Rotate", "enabled":true},
{"mode":"DocSign", "visible":false, "color":-16776961, "kind":"Rotate90", "enabled":false},
{"mode":"DocSign", "visible":true, "color":-14336, "kind":"Next", "enabled":true},
{"mode":"DocSign", "visible":true, "color":-16725761, "kind":"Prev", "enabled":true},
{"mode":"DocSign", "visible":true, "color":-16740298, "kind":"Ok", "enabled":true},
{"mode":"DocSign", "visible":true, "color":-996296, "kind":"Repeat", "enabled":true},
{"mode":"DocSign", "visible":true, "color":-1966054, "kind":"Cancel", "enabled":true}]},
"messageId":"ceec4053-a1f3-4a6f-996d-a4b3e975cd83","type":"response"} |
getButtonEvents
observes the button clicks on the pad. Since v2.2.0
The lazy replies contain "data" that contains "ret" that contains the "kind" of the button which was clicked.
{"data":{"messageId":"13dad597-d82c-44ac-9f6d-0906ce95f775"},"type":"getButtonEvents"}{ "data":{"ret":{"kind":"StartSignature"}}," messageId":"13dad597-d82c-44ac-9f6d-0906ce95f775","type":"response" } |
getDevice
gets the name of the selected device
The reply contains "data" with "ret" with the name.
getDeviceCertificate
gets a certificate which is necessary to verify the last signature.
The reply contains "data" with "ret" with a base64 encoded DER encoded X.509 certificate.
getDeviceCount
gets the number of attached signature devices
reply contains "data" with "ret" with the number of devices.
getDeviceInfo
gets information on the selected device.
The reply contains "data" with "ret" with
"serial", the serial number,
"deviceType", the device type,
"firmwareVersion", the firmware version,
"openState", the open state, it should be zero(0),
"deviceTime", the time as milliseconds since 1970,
"cryptoIdInfo", an XML text containing info about the cryptographic keys stored on the device.
"cryptoIdInfoJson", contains similar information as "cryptoIdInfo" as a JSON array. Since v2.1.0.
deviceType=duraSign 10.0,
serial=123456000,
openState=3,
cryptoIdInfo=<?xml version="1.0" encoding="UTF-8"?><CryptoIDInfoList xmlns="http://www.stepover.com/CryptoIDContaineInfoXMLSchema">
<CryptoIDInfo><id>0</id><description>StepOver cryptoIdv1</description><padCertLength>256</padCertLength><padNotaryLength>256</padNotaryLength></CryptoIDInfo>
<CryptoIDInfo><id>1</id><description>StepOver cryptoIdv2</description><padCertLength>512</padCertLength><padNotaryLength>256</padNotaryLength></CryptoIDInfo>
<CryptoIDInfo><id>2</id><description>StepOver cryptoIdv2</description><padCertLength>512</padCertLength><padNotaryLength>512</padNotaryLength></CryptoIDInfo>
</CryptoIDInfoList>,
cryptoIdInfoJson=[
{"padCertLength":256,"description":"StepOver cryptoIdv1","padNotaryLength":256},
{"padCertLength":512,"description":"StepOver cryptoIdv2","padNotaryLength":256},
{"padCertLength":512,"description":"StepOver cryptoIdv2","padNotaryLength":512}
],
firmwareVersion=7.9.0.354,
deviceTime=1644853028000 |
getDeviceOpened
gets whether the device has been opened.
The reply contains "data" with "ret" with "true" or "false".
getDeviceSerial
Replies "data" that contains a "ret" with the device serial number
getEncryptedAesKey
gets a key that is necessary for decrypting the bioData captured during in the last signature process.
request
"data" contains a "darray" field which is a JSON array of numbers each being an octet of the preliminary document hash
reply
"data" that contains a "ret" field with the base64-encoded encrypted AES key
getNotaryInfo
Replies "data" that contains a "ret" with the notary info.
getPreliminaryData
gets preliminary data including the last signature image.
request
"data" that contains
"withAlpha", whether to use an alpha channel for transparency,
"width" the desired width of the image,
"height" the desired height of the image.
reply
contains "data" with "ret" which contains an array with these items
the bio data,
the certificate necessary to verify the signature as baset64 text,
the last signature image as base64 text,
the notary information as base64 text,
the device name,
the device serial number.
getSignatureImage
gets the signature image in one of two ways.
If startSigning has been called with the "config" map,
this responds a stream of images that ends when the signature ends.
Else, it sends a single image.
"data" may contain
"withAlpha", whether to use an alpha channel for transparency, (true or false),
"width" the desired width,
"height" the desired height.
getSignedFinalDocHash
is obsolete.
getVersion
gets the version of the PadConnector.
The reply contains "data" with "ret" with the version.
keepAlive
Replies "data" that contains a "ret" with the text "ok".
onStaticAppletGetImage
is a lazy reply of
a startSigning or a
a startViewing request.
It either is a signal (1) or a request for an image (2).
How to react to the signal depends on the application.
"data" contains
value0, the one-based page number
value1, is either one (1) or two (2)
In case of an image request as a consequence of a startSigning request,
render the page with the resolution used in that request
and send it as part of the reply to the PadConnector.
Note that zero-based page numbers are used in the startSigning request.
Example
setButtonConfigs
sets the button configuation. Since v2.2.0.
The request contains "data" that contains "buttonConfigs" which is an array of button configs, to change the buttons.
Replies "ok".
setFinalDocHash
sets the final document hash to be signed.
request
"data" contains a "darray" field which is a JSON array of numbers each being an octet of the final document hash
reply
"data" contains a "ret" with the text "ok".
lazy reply
"type" is "onStaticAppletSignedFinalDocHash" contains "data" with "value0" field
that is a JSON array of numbers each being an octet of an RSA signature.
start
resets state and replies ok.
The lazy reply "onStaticAppletLoaded" is sent when the operation completed.
startSigning
starts a signing process.
request
"data" should contain
"page", the page of the signature field,
"x", "y", "width", "height", the position of the signature field in inch/72
where"y" is the upper border from top
"x" is the left border from left
"resolution" tells with how many dots per inch the page will be rendered
and sent as a reply to "onStaticAppletGetImage".
"data" may contain
"withHashDialog" to change whether to sign the final doc hash with the hash dialog on the pad,
"signatureTimeout" to change the signature timeout in ms, the special value zero(0) means infinite.
"data" may contain "config" that may contain
the "cryptoId" to use with the selected pad
"signatureImageIntervalMillis" to change the interval of the image stream,
"signMode" which can be
"inDoc"
"standard",
"afterSignMode" which can be
"noModeChange",
"documentViewing",
"customerLogo"
"textLines" that contains a sequence of key value pairs,
the keys being [0-9]+, the values being lines of text to be displayed on the pad;"buttonConfigs", since v2.2.0, an array of button configs, to change the buttons.
reply
"data" contains a "ret" with the text "ok".
Lazy replies
"onStaticAppletCaptureStarted", is sent when the signer starts to sign.
"onStaticAppletGetImage" is sent when the PadConnector requires an image.
"onStaticAppletSignatureRepeat" is sent when the signature shall be repeated.
"onStaticAppletSignatureFinished" when the signature is finished either by
a "finishSigning" message by the client, or
an "OK" click on the signature pad, or
a timeout after the signer has stopped drawing.
"onStaticAppletSignatureCancel" is sent when the signature has been canceled by a click on the Cancel button on the pad.
"onStaticAppletError" is sent in case of error. If the pad has been disconnected, it contains "data" with "value0" "DISCONNECT".
Remarks
With color pads, this uses the sign-in-document mode, if
the "config" field is not used and "startViewing" has been called before or
the "config" field is used with "signMode" being "inDoc".
The standard sign mode will be used, if "start" or "stopSigning" have been called before.
Before answering the "setFinalDocHash" request with the lazy "onStaticAppletSignedFinalDocHash" reply,
the PC may switch the pad to another mode an "afteSignMode" was given.
If "config" was absent, the PC switches the pad to the customerLogo mode.
startViewing
starts a document viewing process. Supported devices can display document pages.
request
"data" may contain
"pages" with a number being the number of pages.
"buttonConfigs", since v2.2.0, an array of button configs, to change the buttons.
reply
"Ok".
lazy reply
"onStaticAppletGetImage" is sent when the PadConnector requires an image.
stopSigning
stops a signing process.
"data" may contain "showManufacturerLogo", a boolean that tells whether the pad should switch to manufacturer logo mode, also known as customer logo mode, also known as standby mode.