This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import OpenSSL | |
static func pkcs12(fromPem pemCertificate: String, | |
withPrivateKey pemPrivateKey: String, | |
p12Password: String = "", | |
certificateAuthorityFileURL: URL? = nil) throws -> NSData { | |
// Create sec certificates from PEM string | |
let modifiedCert = pemCertificate | |
.replacingOccurrences(of: "-----BEGIN CERTIFICATE-----", with: "") |