JavaScript API funkcijas
getBackendInfo
Funcion
Returns information about end user plugin/extension
Promise window.eparakstshwcrypto.getBackendInfo()
Parameters
none
Result
Returns the Promise
object that corresponds to the BackendInfo
data type.
Errors
Expected errors:
- technical_error.
See section JavaScript API Error Handling.
getCertificate
Funcion
Prompts the user to select a certificate from the list of available certificates. Connection to a browser plugin/extension that allows certificate data to be read from the user's smart card.
Promise window.eparakstshwcrypto.getCertificate(object options)
Parameters
Property | Type | Mandatory | Description | |
---|---|---|---|---|
options | object | no | Conditions for certificate selection. | |
lang | string | no | Preferred user interface language (ISO-639-1 code). Supported languages:
| |
operation | string | no | type of operation:
|
Result
Returns the Promise
object that corresponds to the Certificate
data type.
Errors
Expected errors:
- no_implementation;
- no_certificates;
- user_cancel
- technical_error.
See section JavaScript API Error Handling.
sign
Function
Requires the user to sign the prepared HASH value (signable data for example). Connection to a browser plugin/extension that provides signing on the user's smart card.
Promise window.eparakstshwcrypto.sign(object certificate, object hash, object options)
Parameters
Property | Type | Mandatory | Description | |
---|---|---|---|---|
certificate | object | yes | Certificate to use the corresponding private key for signing. An object corresponding to the Certificate data type was obtained using the getCertificate function. | |
hash | object | yes | Prepared signable HASH value | |
type | string | yes | Signale HASH value algorithm type:
For Authentication “ For Batch signing “ Batch signing is available in Chrome and Firefox 50+ browser versions | |
hex | string | yes | Signable HASH value in HEX encoding. If " " " | |
options | object | no | Signing conditions | |
lang | string | no | Preferred user interface language (ISO-639-1 code). Supported languages:
The user interface language is not fully affected because the language used can be determined by the operating system or browser. | |
operation | string | no | Type of operation:
| |
info | string | no | Informative text (document title, transaction amount, etc.). |
Result
Returns the Promise
object that corresponds to the Signature
data type.
Errors
Expected errors:
- no_implementation;
- invalid_argument;
- user_cancel;
- technical_error;
- pin_blocked.
See section JavaScript API Error Handling.