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]+".
searches devices and selects one of them.
The reply contains "data" with "ret" with a one(1) in case of success.
ends a running signature capture in a similar way as the OK click on the device.
This should lead to a lazy "onStaticAppletSignatureFinished" reply.
gets biodata.
The reply contains "data" that contains a "ret" field with the biodata as a base64-encoded sequence of naturaSignV2 records.
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.
|
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.
|
gets the name of the selected device
The reply contains "data" with "ret" with the name.
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.
gets the number of attached signature devices
reply contains "data" with "ret" with the number of devices.
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.
|
gets whether the device has been opened.
The reply contains "data" with "ret" with "true" or "false".
Replies "data" that contains a "ret" with the device serial number
gets a key that is necessary for decrypting the bioData captured during in the last signature process.
"data" contains a "darray" field which is a JSON array of numbers each being an octet of the preliminary document hash
"data" that contains a "ret" field with the base64-encoded encrypted AES key
Replies "data" that contains a "ret" with the notary info.
gets preliminary data including the last signature image.
"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.
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.
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.
is obsolete.
gets the version of the PadConnector.
The reply contains "data" with "ret" with the version.
Replies "data" that contains a "ret" with the text "ok".
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
|
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".
|
sets the final document hash to be signed.
"data" contains a "darray" field which is a JSON array of numbers each being an octet of the final document hash
"data" contains a "ret" with the text "ok".
"type" is "onStaticAppletSignedFinalDocHash" contains "data" with "value0" field
that is a JSON array of numbers each being an octet of an RSA signature.
resets state and replies ok.
The lazy reply "onStaticAppletLoaded" is sent when the operation completed.
starts a signing process.
"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.
"data" contains a "ret" with the text "ok".
"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".
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.
starts a document viewing process. Supported devices can display document pages.
"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.
"Ok".
"onStaticAppletGetImage" is sent when the PadConnector requires an image.
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.