Newbie here. I am tasked to handle x509certificate
in swift. It seems this x509
thing sounds scary. I try my best to describe what I want to achieve. Hope you can guide me.
Below is what I try to achieve:
1) I would like to know, what I need in Swift to handle the x509certificate p12 file and private Key
2) How to Sign with private key by RSA
In C#, below code is to get a private Key
public static RSACryptoServiceProvider UsePrivateKeyFromP12(string certFileName, string pwd)
{
var privateCert = new X509Certificate2(System.IO.File.ReadAllBytes(certificateFileName), password);
return (RSACryptoServiceProvider)privateCert.PrivateKey;
}
How would I do in Swift? The private key will be on the client side.
Thanks