9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
+
+
+
|
#include <ppapi/cpp/instance.h>
#include <ppapi/cpp/module.h>
#include <ppapi/cpp/core.h>
#include <ppapi/cpp/var.h>
#include <ppapi/cpp/var_dictionary.h>
#include <ppapi/cpp/var_array.h>
#include <ppapi/cpp/var_array_buffer.h>
#include <string.h>
#include <stdlib.h>
#include "pcsc-nacl.h"
#include "cackey-chrome.h"
class CACKeyInstance : public pp::Instance {
private:
pp::Core *corePointer;
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
-
+
+
+
|
/*
* Do the thing we are being asked to do
*/
reply = new pp::VarDictionary();
if (command.AsString() == "init") {
if (message->HasKey("smartcardManagerAppId")) {
smartcardManagerAppId = message->Get("smartcardManagerAppId").AsString().c_str();
smartcardManagerAppId = strdup(message->Get("smartcardManagerAppId").AsString().c_str());
}
pcscNaClInit(this, corePointer, smartcardManagerAppId, "CACKey");
free((void *) smartcardManagerAppId);
reply->Set("status", "success");
} else if (command.AsString() == "listcertificates") {
numCertificates = cackey_chrome_listCertificates(&certificates);
certificatesPPArray.SetLength(numCertificates);
|