-
Notifications
You must be signed in to change notification settings - Fork 47
Backend SignWiseAPI
Martin Paljak edited this page Jan 25, 2017
·
1 revision
- As implemented by: https://www.signwise.me/p/about/plugin
- MIME type:
application/x-signwiseplugin
- Synchronous interface
- Calling website needs to embed the plugin invocation code into the website, with something like:
<object id="signwiseplugin" type="application/x-signwiseplugin"/>
- Result of functions is available from
plugin.result
- Does not work with multiple inserted cards - expects a single card
- Does not have user privacy (certificate is sent to the service without user consent)
- Supports pin pad
- Talks directly to supported cards via PC/SC
Assumes that the plugin reference is fetched by something like:
var plugin = document.getElementById("signwiseplugin");
Contains the version string of the plugin (variable, not function)
- example
window.alert(plugin.result);
Gets the signing certificate of the inserted smart card as Hex encoded string
- arguments
- none
- returns
-
true
orfalse
-
- example
plugin.getSigningCertificate(); window.alert(plugin.result);
Asks the PIN from the user and calculates a signature of a hash
- arguments
- language
- hash
- hashype
- returns
-
true
orfalse
-
- example
plugin.sign('en', '0A..0F', 'sha1'); window.alert(plugin.result);
Gets the signing certificate of the inserted smart card as Hex encoded string
- arguments
- none
- returns
-
true
orfalse
-
- example
plugin.getAuthenticationCertificate(); window.alert(plugin.result);
Asks the PIN from the user and calculates a signature of a hash with authentication key
- arguments
- language
- hash
- returns
-
true
orfalse
-
- example
plugin.authenticate('en', '0A..0F'); window.alert(plugin.result);
Native Messaging provides the same API but with a callback with error and result arguments appended to function signatures and the functionality hidden behind a SignWiseChromePlugin()
class:
-
s = new SignWiseChromePlugin();
s.getVersion(function(error, result))
s.getSigningCertificate(function(error, result))
s.sign(language, hash, hashtype, function(error, result))
s.getAuthenticationCertificate(function(error, result))
s.authenticate(language, hash, function(error, result))