summaryrefslogtreecommitdiffstats
path: root/dom/secureelement/gonk/nsISecureElementConnector.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/secureelement/gonk/nsISecureElementConnector.idl
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/secureelement/gonk/nsISecureElementConnector.idl')
-rw-r--r--dom/secureelement/gonk/nsISecureElementConnector.idl124
1 files changed, 124 insertions, 0 deletions
diff --git a/dom/secureelement/gonk/nsISecureElementConnector.idl b/dom/secureelement/gonk/nsISecureElementConnector.idl
new file mode 100644
index 000000000..92cc1eb2b
--- /dev/null
+++ b/dom/secureelement/gonk/nsISecureElementConnector.idl
@@ -0,0 +1,124 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+
+[scriptable, uuid(1ff3f35a-1b6f-4e65-a89e-a363b8604cd7)]
+interface nsISEChannelCallback : nsISupports
+{
+ /**
+ * Callback function to notify on successfully opening a logical channel.
+ *
+ * @param channel
+ * The Channel Number/Handle that is successfully opened.
+ * @param openResponse
+ * Response from SE for OpenChannel operation.
+ */
+ void notifyOpenChannelSuccess(in long channel, in DOMString openResponse);
+
+ /**
+ * Callback function to notify on successfully closing the logical channel.
+ *
+ */
+ void notifyCloseChannelSuccess();
+
+ /**
+ * Callback function to notify the status of 'seExchangeAPDU' command.
+ *
+ * @param sw1
+ * Response's First Status Byte
+ * @param sw2
+ * Response's Second Status Byte
+ * @param data
+ * Response's data
+ */
+ void notifyExchangeAPDUResponse(in octet sw1,
+ in octet sw2,
+ in DOMString data);
+
+ /**
+ * Callback function to notify error
+ *
+ * @param error
+ * Error describing the reason for failure.
+ */
+ void notifyError(in DOMString error);
+};
+
+[scriptable, uuid(417f59ee-f582-45b9-9a4e-e9dcefecb4f7)]
+interface nsISEListener : nsISupports
+{
+ void notifySEPresenceChanged(in DOMString seType, in boolean isPresent);
+};
+
+[scriptable, uuid(3cef313a-1d01-432d-9cd2-6610a80911f3)]
+interface nsISecureElementConnector : nsISupports
+{
+ /**
+ * Open a logical communication channel with the specific secure element type
+ *
+ * @param aid
+ * Application Identifier of the Card Applet on the secure element.
+ * @param callback
+ * callback to notify the result of the operation.
+ */
+ void openChannel(in DOMString aid,
+ in nsISEChannelCallback callback);
+
+ /**
+ * Exchanges APDU channel with the specific secure element type
+ *
+ * @param channel
+ * Channel on which C-APDU to be transmitted.
+ * @param cla
+ Class Byte.
+ * @param ins
+ Instruction Byte
+ * @param p1
+ Reference parameter first byte
+ * @param p2
+ Reference parameter second byte
+ * Refer to 3G TS 31.101 , 10.2 'Command APDU Structure' for all the cases.
+ * @param data
+ Sequence of C-APDU data octets
+ * @param le [optional]
+ * le is the length of expected response. If the response is not expected,
+ it should be explicitly set to -1.
+ * @param callback
+ * callback to notify the result of the operation.
+ */
+ void exchangeAPDU(in long channel,
+ in octet cla,
+ in octet ins,
+ in octet p1,
+ in octet p2,
+ in DOMString data,
+ in short le,
+ in nsISEChannelCallback callback);
+
+ /**
+ * Closes the logical communication channel to the specific secure element type
+ *
+ * @param channel
+ * Channel to be closed.
+ * @param callback
+ * callback to notify the result of the operation.
+ */
+ void closeChannel(in long channel,
+ in nsISEChannelCallback callback);
+
+ /**
+ * Register a Secure Element listener
+ *
+ * @param listener
+ */
+ void registerListener(in nsISEListener listener);
+
+ /**
+ * Unregister a Secure Element listener
+ *
+ * @param listener
+ */
+ void unregisterListener(in nsISEListener listener);
+};