Module: Tem::Apdus::Lifecycle

Included in:
Session
Defined in:
lib/tem/apdus/lifecycle.rb

Instance Method Summary collapse

Instance Method Details

#activateObject



12
13
14
# File 'lib/tem/apdus/lifecycle.rb', line 12

def activate
  @transport.iso_apdu(:ins => 0x10)[:status] == 0x9000
end

#fw_versionObject

The TEM firmware version.

Returns a hash with the keys :major and :minor whose values are version numbers.



23
24
25
26
27
28
29
30
31
32
# File 'lib/tem/apdus/lifecycle.rb', line 23

def fw_version
  raw = @transport.iso_apdu :ins => 0x12
  return { :major => 0, :minor => 1 } if raw[:status] == 0x6D00
  if raw[:status] != 0x9000
    Smartcard::Iso::IsoCardMixin.raise_response_exception raw
  end
  
  { :major => read_tem_byte(raw[:data], 0),
    :minor => read_tem_byte(raw[:data], 1) }
end

#killObject



15
16
17
# File 'lib/tem/apdus/lifecycle.rb', line 15

def kill
  @transport.iso_apdu(:ins => 0x11)[:status] == 0x9000
end