Module: Smartcard::Iso::JcopRemoteServingStubs
- Defined in:
- lib/smartcard/iso/jcop_remote_server.rb
Overview
Stubs out the methods that can be implemented by the serving logic in a JCOP remote server. Serving logic classes should mix in this module, to avoid having unimplemented methods.
Instance Method Summary collapse
-
#card_atr ⇒ Object
The smartcard’s ATR.
-
#connection_end ⇒ Object
Called when a client connection is closed.
-
#connection_start ⇒ Object
Called when a client connection accepted.
-
#exchange_apdu(apdu) ⇒ Object
Serving logic handling an APDU exchange.
Instance Method Details
#card_atr ⇒ Object
The smartcard’s ATR.
48 49 50 51 52 |
# File 'lib/smartcard/iso/jcop_remote_server.rb', line 48 def card_atr # ATR from the card simulator in JCOP 3.2.7. [0x3B, 0xF8, 0x13, 0x00, 0x00, 0x81, 0x31, 0xFE, 0x45, 0x4A, 0x43, 0x4F, 0x50, 0x76, 0x32, 0x34, 0x31, 0xB7].pack('C*') end |
#connection_end ⇒ Object
Called when a client connection is closed.
This method serves as a notification to the serving logic implementation. Its return value is discarded.
30 31 32 |
# File 'lib/smartcard/iso/jcop_remote_server.rb', line 30 def connection_end nil end |
#connection_start ⇒ Object
Called when a client connection accepted.
This method serves as a notification to the serving logic implementation. Its return value is discarded.
22 23 24 |
# File 'lib/smartcard/iso/jcop_remote_server.rb', line 22 def connection_start nil end |
#exchange_apdu(apdu) ⇒ Object
Serving logic handling an APDU exchange.
:call-seq:
logic.exchange_apdu(apdu) -> array
The |apdu| parameter is the request APDU, formatted as an array of integers between 0 and 255. The method should return the response APDU, formatted in a similar manner.
42 43 44 45 |
# File 'lib/smartcard/iso/jcop_remote_server.rb', line 42 def exchange_apdu(apdu) # Dumb implementation that always returns OK. [0x90, 0x00] end |