-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathweb-smart-card.idl
179 lines (149 loc) · 4.43 KB
/
web-smart-card.idl
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: Web Smart Card API (https://wicg.github.io/web-smart-card/)
[Exposed=Window, SecureContext]
partial interface Navigator {
[SameObject] readonly attribute SmartCardResourceManager smartCard;
};
[Exposed=(DedicatedWorker, SharedWorker), SecureContext]
partial interface WorkerNavigator {
[SameObject] readonly attribute SmartCardResourceManager smartCard;
};
[Exposed=(DedicatedWorker, SharedWorker, Window), SecureContext]
interface SmartCardResourceManager {
Promise<SmartCardContext> establishContext();
};
[Exposed=(DedicatedWorker, SharedWorker, Window), SecureContext]
interface SmartCardContext {
Promise<sequence<DOMString>> listReaders();
Promise<sequence<SmartCardReaderStateOut>> getStatusChange(
sequence<SmartCardReaderStateIn> readerStates,
optional SmartCardGetStatusChangeOptions options = {});
Promise<SmartCardConnectResult> connect(
DOMString readerName,
SmartCardAccessMode accessMode,
optional SmartCardConnectOptions options = {});
};
dictionary SmartCardReaderStateIn {
required DOMString readerName;
required SmartCardReaderStateFlagsIn currentState;
unsigned long currentCount;
};
dictionary SmartCardReaderStateFlagsIn {
boolean unaware = false;
boolean ignore = false;
boolean unavailable = false;
boolean empty = false;
boolean present = false;
boolean exclusive = false;
boolean inuse = false;
boolean mute = false;
boolean unpowered = false;
};
dictionary SmartCardReaderStateOut {
required DOMString readerName;
required SmartCardReaderStateFlagsOut eventState;
required unsigned long eventCount;
ArrayBuffer answerToReset;
};
dictionary SmartCardReaderStateFlagsOut {
boolean ignore = false;
boolean changed = false;
boolean unavailable = false;
boolean unknown = false;
boolean empty = false;
boolean present = false;
boolean exclusive = false;
boolean inuse = false;
boolean mute = false;
boolean unpowered = false;
};
dictionary SmartCardGetStatusChangeOptions {
DOMHighResTimeStamp timeout;
AbortSignal signal;
};
enum SmartCardProtocol {
"raw",
"t0",
"t1"
};
dictionary SmartCardConnectResult {
required SmartCardConnection connection;
SmartCardProtocol activeProtocol;
};
enum SmartCardAccessMode {
"shared",
"exclusive",
"direct"
};
dictionary SmartCardConnectOptions {
sequence<SmartCardProtocol> preferredProtocols;
};
[Exposed=(DedicatedWorker, SharedWorker, Window), SecureContext]
interface SmartCardConnection {
Promise<undefined> disconnect(optional SmartCardDisposition disposition = "leave");
Promise<ArrayBuffer> transmit(BufferSource sendBuffer,
optional SmartCardTransmitOptions options = {});
Promise<undefined> startTransaction(SmartCardTransactionCallback transaction,
optional SmartCardTransactionOptions options = {});
Promise<SmartCardConnectionStatus> status();
Promise<ArrayBuffer> control([EnforceRange] unsigned long controlCode,
BufferSource data);
Promise<ArrayBuffer> getAttribute([EnforceRange] unsigned long tag);
Promise<undefined> setAttribute([EnforceRange] unsigned long tag, BufferSource value);
};
callback SmartCardTransactionCallback = Promise<SmartCardDisposition?> ();
enum SmartCardDisposition {
"leave",
"reset",
"unpower",
"eject"
};
dictionary SmartCardTransmitOptions {
SmartCardProtocol protocol;
};
dictionary SmartCardTransactionOptions {
AbortSignal signal;
};
dictionary SmartCardConnectionStatus {
required DOMString readerName;
required SmartCardConnectionState state;
ArrayBuffer answerToReset;
};
enum SmartCardConnectionState {
"absent",
"present",
"swallowed",
"powered",
"negotiable",
"t0",
"t1",
"raw"
};
[Exposed=(DedicatedWorker, SharedWorker, Window), Serializable]
interface SmartCardError : DOMException {
constructor(optional DOMString message = "", SmartCardErrorOptions options);
readonly attribute SmartCardResponseCode responseCode;
};
dictionary SmartCardErrorOptions {
required SmartCardResponseCode responseCode;
};
enum SmartCardResponseCode {
"no-service",
"no-smartcard",
"not-ready",
"not-transacted",
"proto-mismatch",
"reader-unavailable",
"removed-card",
"reset-card",
"server-too-busy",
"sharing-violation",
"system-cancelled",
"unknown-reader",
"unpowered-card",
"unresponsive-card",
"unsupported-card",
"unsupported-feature"
};