diff --git a/PatientScannerDemo/Extensions/SwiftCBOR.CBOR.swift b/PatientScannerDemo/Extensions/SwiftCBOR.CBOR.swift index ff7eaf0..d240400 100644 --- a/PatientScannerDemo/Extensions/SwiftCBOR.CBOR.swift +++ b/PatientScannerDemo/Extensions/SwiftCBOR.CBOR.swift @@ -25,7 +25,7 @@ extension SwiftCBOR.CBOR { case let .unsignedInt(val): return "\(val)" case let .negativeInt(val): - return "-\(val)" + return "-\(val + 1)" case let .utf8String(val): return "\"\(val)\"" case let .array(vals): diff --git a/PatientScannerDemo/Models/HCert.swift b/PatientScannerDemo/Models/HCert.swift index cf53f18..4b15b7c 100644 --- a/PatientScannerDemo/Models/HCert.swift +++ b/PatientScannerDemo/Models/HCert.swift @@ -20,8 +20,9 @@ struct HCert { let bodyStr = CBOR.payload(from: cborData)?.toString() ?? "{}" header = JSON(parseJSON: headerStr) var body = JSON(parseJSON: bodyStr) - if body["-259"].exists() { - body = body["-259"] + print(body) + if body["-260"].exists() { + body = body["-260"] } if body["1"].exists() { body = body["1"]