closes #2
This commit is contained in:
parent
4703e6061f
commit
ed485589ac
|
@ -1,5 +1,5 @@
|
||||||
enum AppInfoTag: UInt8 {
|
enum AppInfoTag: UInt8 {
|
||||||
case template = 0x04
|
case template = 0xA4
|
||||||
case pubKey = 0x80
|
case pubKey = 0x80
|
||||||
case uid = 0x8f
|
case uid = 0x8f
|
||||||
case keyUID = 0x8e
|
case keyUID = 0x8e
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
enum AppStatusTag: UInt8 {
|
||||||
|
case template = 0xA3
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ApplicationStatus {
|
||||||
|
let pinRetryCount: Int
|
||||||
|
let pukRetryCount: Int
|
||||||
|
let hasMasterKey: Bool
|
||||||
|
|
||||||
|
init(_ data: [UInt8]) throws {
|
||||||
|
let tlv = TinyBERTLV(data)
|
||||||
|
_ = try tlv.enterConstructed(tag: AppStatusTag.template.rawValue)
|
||||||
|
pinRetryCount = try tlv.readInt()
|
||||||
|
pukRetryCount = try tlv.readInt()
|
||||||
|
hasMasterKey = try tlv.readBoolean()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue