Получить дату истечения срока действия файла .crt в ios ⇐ IOS
-
Anonymous
Получить дату истечения срока действия файла .crt в ios
I've few .crt file and .provisionalprofile and i need to display the expiry date.
tried to convert .crt to data and do encoding
func getExpiryDate() { guard let url = Bundle.main.url(forResource: "sample", withExtension: "crt"), let data = try? Data(contentsOf: url) else { return } data.withUnsafeBytes { (bytes: UnsafePointer)->Void in if let dataPtr = CFDataCreate(kCFAllocatorDefault, UnsafePointer(bytes), data.count) { print(dataPtr) if let plistData = String(data: dataPtr as Data, encoding: .isoLatin1) { } } } }
Источник: https://stackoverflow.com/questions/781 ... ile-in-ios
I've few .crt file and .provisionalprofile and i need to display the expiry date.
tried to convert .crt to data and do encoding
func getExpiryDate() { guard let url = Bundle.main.url(forResource: "sample", withExtension: "crt"), let data = try? Data(contentsOf: url) else { return } data.withUnsafeBytes { (bytes: UnsafePointer)->Void in if let dataPtr = CFDataCreate(kCFAllocatorDefault, UnsafePointer(bytes), data.count) { print(dataPtr) if let plistData = String(data: dataPtr as Data, encoding: .isoLatin1) { } } } }
Источник: https://stackoverflow.com/questions/781 ... ile-in-ios
Мобильная версия