diff --git a/ios/Classes/Types/SecCertificate.swift b/ios/Classes/Types/SecCertificate.swift index 06a17970..e7292f22 100644 --- a/ios/Classes/Types/SecCertificate.swift +++ b/ios/Classes/Types/SecCertificate.swift @@ -10,9 +10,6 @@ import Foundation extension SecCertificate { var data: Data { let serverCertificateCFData = SecCertificateCopyData(self) - let data = CFDataGetBytePtr(serverCertificateCFData) - let size = CFDataGetLength(serverCertificateCFData) - let certificateData = NSData(bytes: data, length: size) - return Data(certificateData) + return serverCertificateCFData as Data } } diff --git a/macos/Classes/Types/SecCertificate.swift b/macos/Classes/Types/SecCertificate.swift index 06a17970..e7292f22 100644 --- a/macos/Classes/Types/SecCertificate.swift +++ b/macos/Classes/Types/SecCertificate.swift @@ -10,9 +10,6 @@ import Foundation extension SecCertificate { var data: Data { let serverCertificateCFData = SecCertificateCopyData(self) - let data = CFDataGetBytePtr(serverCertificateCFData) - let size = CFDataGetLength(serverCertificateCFData) - let certificateData = NSData(bytes: data, length: size) - return Data(certificateData) + return serverCertificateCFData as Data } }