Class: AndroidKeyAttestation::KeyDescription
- Inherits:
-
Object
- Object
- AndroidKeyAttestation::KeyDescription
- Defined in:
- lib/android_key_attestation/key_description.rb
Constant Summary collapse
- ATTESTATION_VERSION_INDEX =
0
- ATTESTATION_SECURITY_LEVEL_INDEX =
1
- KEYMASTER_VERSION_INDEX =
2
- KEYMASTER_SECURITY_LEVEL_INDEX =
3
- ATTESTATION_CHALLENGE_INDEX =
4
- UNIQUE_ID_INDEX =
5
- SOFTWARE_ENFORCED_INDEX =
6
- TEE_ENFORCED_INDEX =
7
- SECURITY_LEVEL_ENUM =
{ 0 => :software, 1 => :trusted_environment, 2 => :strong_box }.freeze
Instance Method Summary collapse
- #attestation_challenge ⇒ Object
- #attestation_security_level ⇒ Object
- #attestation_version ⇒ Object
-
#initialize(sequence) ⇒ KeyDescription
constructor
A new instance of KeyDescription.
- #keymaster_security_level ⇒ Object
- #keymaster_version ⇒ Object
- #software_enforced ⇒ Object
- #tee_enforced ⇒ Object
- #unique_id ⇒ Object
Constructor Details
#initialize(sequence) ⇒ KeyDescription
Returns a new instance of KeyDescription.
23 24 25 |
# File 'lib/android_key_attestation/key_description.rb', line 23 def initialize(sequence) @sequence = sequence end |
Instance Method Details
#attestation_challenge ⇒ Object
43 44 45 |
# File 'lib/android_key_attestation/key_description.rb', line 43 def attestation_challenge sequence[ATTESTATION_CHALLENGE_INDEX].value end |
#attestation_security_level ⇒ Object
31 32 33 |
# File 'lib/android_key_attestation/key_description.rb', line 31 def attestation_security_level SECURITY_LEVEL_ENUM.fetch(Integer(sequence[ATTESTATION_SECURITY_LEVEL_INDEX].value)) end |
#attestation_version ⇒ Object
27 28 29 |
# File 'lib/android_key_attestation/key_description.rb', line 27 def attestation_version Integer(sequence[ATTESTATION_VERSION_INDEX].value) end |
#keymaster_security_level ⇒ Object
39 40 41 |
# File 'lib/android_key_attestation/key_description.rb', line 39 def keymaster_security_level SECURITY_LEVEL_ENUM.fetch(Integer(sequence[KEYMASTER_SECURITY_LEVEL_INDEX].value)) end |
#keymaster_version ⇒ Object
35 36 37 |
# File 'lib/android_key_attestation/key_description.rb', line 35 def keymaster_version Integer(sequence[KEYMASTER_VERSION_INDEX].value) end |
#software_enforced ⇒ Object
55 56 57 |
# File 'lib/android_key_attestation/key_description.rb', line 55 def software_enforced @software_enforced ||= AuthorizationList.new(sequence[SOFTWARE_ENFORCED_INDEX].value) end |
#tee_enforced ⇒ Object
51 52 53 |
# File 'lib/android_key_attestation/key_description.rb', line 51 def tee_enforced @tee_enforced ||= AuthorizationList.new(sequence[TEE_ENFORCED_INDEX].value) end |
#unique_id ⇒ Object
47 48 49 |
# File 'lib/android_key_attestation/key_description.rb', line 47 def unique_id sequence[UNIQUE_ID_INDEX].value end |