Object
Check if the ATR is correct. If false, the data of this Card object could be wrong and the calculations based on this data wrong.
# File lib/ctapi.rb, line 464 def atr_ok? @atr[4, 2] == "\x90\x00" && @atr[2] == 0x10 end
Returns adescription of this card including the ATR as a string.
# File lib/ctapi.rb, line 518 def inspect string = to_s string[-1] = " #{atr}>" string end
The bit width of this chipcard.
# File lib/ctapi.rb, line 469 def memory_bits 1 << (@atr[1] & 0x07) end
Number of memory blocks on this chipcard.
# File lib/ctapi.rb, line 474 def memory_blocks 1 << (((@atr[1] & 0x78) >> 3) + 6) end
Computes the memory size of the inserted chipcard in bytes.
# File lib/ctapi.rb, line 479 def memory_size (memory_blocks * memory_bits >> 3) end
Supported protocol of this chipcard.
# File lib/ctapi.rb, line 497 def protocol if (@atr[0] & 0x80) == 0x00 'ISO' elsif (@atr[0] & 0xf0) == 0x80 'I2C' elsif (@atr[0] & 0xf0) == 0x90 '3W' elsif (@atr[0] & 0xf0) == 0xa0 '2W' else 'unknown' end end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.