forked from romansopov/RutokenJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
36 lines (30 loc) · 859 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<title>Test</title>
</head>
<body>
<script type="text/javascript">
var rutoken = require('./rutoken/rutoken');
var gui = require('nw.gui');
var fs = require('fs');
console.log(gui.App.dataPath);
console.log('initialize() ', rutoken.initialize());
console.log('isInitialize() ', rutoken.isInitialize());
var cntSlot = rutoken.countSlot();
console.log('cntSlot: ', cntSlot);
if(cntSlot > 0) {
for(var i=0; i <= cntSlot-1; i++) {
rutoken.getSlotInfo(i, function(data) {
console.log('Slot info #' + i + "\n", data);
});
rutoken.getTokenInfo(i, function(data) {
console.log('Token info #' + i + "\n", data);
});
rutoken.getMechanismList(i, function(data) {
console.log('Mechanism list #' + i + "\n", data);
});
}
}
</script>
</body>
</html>