Constructor
new GrabbaSmartcard()
Access Grabba smartcard capabilities via grabba.smartcard
Methods
exchangeAPDU(onSuccess, onError, interface, commandAPDU)
Exchange an APDU with the given smartcard slot.
Parameters:
Name | Type | Description |
---|---|---|
onSuccess |
function | Called on success with the following parameter: {int[]} response The response APDU. |
onError |
function | Called on error with the following parameters: {String} error description. |
interface |
int | The Smartcard interface to use, pass 0 for primary slot, 1 for SAM slot |
commandAPDU |
Array.<int> | The APDU to send to the card |
isSupported(onSuccess, isInserted, onError)
Determines if the currently connected Grabba supports proxcard functionality.
Parameters:
Name | Type | Description |
---|---|---|
onSuccess |
function | Called on success with the following parameters: {boolean} Boolean indicating if GrabbaSmartcard is supported. |
isInserted |
function | Called on success with the following parameters: {boolean} Boolean indicating if GrabbaSmartcard is inserted. |
onError |
function | Called on error with the following parameters: {String} error description. |
registerCallback(callback, onError)
Register callbacks for Smartcard related events.
If no callbacks are passed to this function, all present callbacks will be cleared.
If no callbacks are passed to this function, all present callbacks will be cleared.
Parameters:
Name | Type | Description |
---|---|---|
callback |
Object | An object which implements the following functions: insertedEvent : function(){} Called when the smartcard is inserted. removedEvent : function(){} Called when the smartcard is removed. |
onError |
function | Called on error with the following parameters: {String} error description. |
startSession(onSuccess, onError, interface)
Starts a communication session with a card in a given interface on a connected Grabba device.
Parameters:
Name | Type | Description |
---|---|---|
onSuccess |
function | Called on success with the following parameter: {int[]} atr raw array containing card ATR data. |
onError |
function | Called on error with the following parameters: {String} error description. |
interface |
int | The Smartcard interface to use, pass 0 for primary slot, 1 for SAM slot |