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 NetworkExtension | |
class VPNIKEv2Setup { | |
static let shared = VPNIKEv2Setup() | |
let vpnManager = NEVPNManager.shared() | |
func initVPNTunnelProviderManager() { |
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
func StackOverFrowReadPCKS12() { | |
if let url = Bundle.main.url(forResource: "client", withExtension: "p12") { | |
let PKCS12Data = NSData(contentsOf: url) | |
let inPKCS12Data = CFDataCreate(kCFAllocatorDefault, PKCS12Data!.bytes.assumingMemoryBound(to: UInt8.self), (PKCS12Data?.length)!) | |
let keys: [CFString] = [kSecImportExportPassphrase] | |
let values: [CFTypeRef] = [] | |
let keysPointer = UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: keys.count) |