Class: MIFARE::DESFire::KEY_SETTING
- Inherits:
-
Struct
- Object
- Struct
- MIFARE::DESFire::KEY_SETTING
- Defined in:
- lib/mifare/des_fire.rb
Instance Attribute Summary collapse
-
#file_configurable_without_auth ⇒ Object
Returns the value of attribute file_configurable_without_auth.
-
#file_management_without_auth ⇒ Object
Returns the value of attribute file_management_without_auth.
-
#key_setting_changeable ⇒ Object
Returns the value of attribute key_setting_changeable.
-
#masterkey_changeable ⇒ Object
Returns the value of attribute masterkey_changeable.
-
#privileged_key ⇒ Object
Returns the value of attribute privileged_key.
Class Method Summary collapse
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize ⇒ KEY_SETTING
constructor
A new instance of KEY_SETTING.
Constructor Details
#initialize ⇒ KEY_SETTING
Returns a new instance of KEY_SETTING.
89 90 91 92 93 94 95 96 |
# File 'lib/mifare/des_fire.rb', line 89 def initialize(*) super self.privileged_key = 0 if self.privileged_key.nil? self.masterkey_changeable = true if self.masterkey_changeable.nil? self.file_management_without_auth = true if self.file_management_without_auth.nil? self.file_configurable_without_auth = true if self.file_configurable_without_auth.nil? self.key_setting_changeable = true if self.key_setting_changeable.nil? end |
Instance Attribute Details
#file_configurable_without_auth ⇒ Object
Returns the value of attribute file_configurable_without_auth
73 74 75 |
# File 'lib/mifare/des_fire.rb', line 73 def file_configurable_without_auth @file_configurable_without_auth end |
#file_management_without_auth ⇒ Object
Returns the value of attribute file_management_without_auth
73 74 75 |
# File 'lib/mifare/des_fire.rb', line 73 def file_management_without_auth @file_management_without_auth end |
#key_setting_changeable ⇒ Object
Returns the value of attribute key_setting_changeable
73 74 75 |
# File 'lib/mifare/des_fire.rb', line 73 def key_setting_changeable @key_setting_changeable end |
#masterkey_changeable ⇒ Object
Returns the value of attribute masterkey_changeable
73 74 75 |
# File 'lib/mifare/des_fire.rb', line 73 def masterkey_changeable @masterkey_changeable end |
#privileged_key ⇒ Object
Returns the value of attribute privileged_key
73 74 75 |
# File 'lib/mifare/des_fire.rb', line 73 def privileged_key @privileged_key end |
Class Method Details
.import(byte) ⇒ Object
98 99 100 101 102 103 104 105 106 |
# File 'lib/mifare/des_fire.rb', line 98 def self.import(byte) self.new( (byte >> 4) & 0x0F, byte & 0x01 != 0, byte & 0x02 != 0, byte & 0x04 != 0, byte & 0x08 != 0 ) end |
Instance Method Details
#export ⇒ Object
108 109 110 111 112 113 114 115 |
# File 'lib/mifare/des_fire.rb', line 108 def export output = (self.privileged_key << 4) output |= 0x01 if self.masterkey_changeable output |= 0x02 if self.file_management_without_auth output |= 0x04 if self.file_configurable_without_auth output |= 0x08 if self.key_setting_changeable output end |