Skip to content

Instantly share code, notes, and snippets.

View chenenyu's full-sized avatar
👷‍♂️
Flutter

chenenyu

👷‍♂️
Flutter
View GitHub Profile
@perlmunger
perlmunger / SecCertificateWrapper.swift
Last active September 22, 2023 14:05
A wrapper around SecCertificate to simplify accessing iOS app certificate properties found in the embedded.mobileprovision file inside the bundle payload. The WrapperImplementation file shows how to extract both the provisioning profile and the details of each certificate. Works on iOS 12, iOS 13, and newer
struct SecCertificateWrapper : Comparable {
var data:Data
var cert:SecCertificate
// Initialize with a data object from the "DeveloperCertificates"
// array (see WrapperImplementation.swift)
init(data:Data) {
self.cert = SecCertificateCreateWithData(nil, data as CFData)!
// Use this later for parsing the date details from the cert