I need to get public key from certificate
I've found a way to do it on iOS 12+ and iOS 10.3+, but how can I do it on iOS 10.0+?
func publicKey(for certificate: SecCertificate) -> SecKey? {
if #available(iOS 12.0, *) {
return SecCertificateCopyKey(certificate)
} else if #available(iOS 10.3, *) {
return SecCertificateCopyPublicKey(certificate)
} else {
// ???
return nil
}
}