How to install VPN root certificate in iOS Profile & Device Management and Trust Store Programmatically?
I am using NEVPNManager & IKEV2 certificate as my authentication method for connecting to the VPN. I am able to connect to the VPN. Below mentioned is my sample block of code.
guard let path = Bundle.main.path(forResource: VPNConstants.certificateName, ofType: ".p12") else {
fatalError("Unable to find Certificate")
}
do {
let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe)
ikev2.identityData = data
}
catch {
fatalError("Unable to find Certificate")
}
ikev2.identityDataPassword = VPNConstants.password
I tried to install the root certificate using SecCertificateCreateWithData and SecItemAdd methods part of the Security framework, I don't get any errors installing the certificate, but it doesn't appear in my iOS Profile & Device Management and TrustStore.
Any help is appreciated, Thanks in advance!!!