Hello Guys,
Is there any similar method/s to System.Security.Cryptography.X509Certificates namespace from .Net ? or mode specific, System.Security.Cryptography.X509Certificates
I need to decrypt a certificate using the password I have and to get the details of if . On .Net I have the following code from a sample :
private static X509Certificate2 GetCertificate(byte[] certBytes, string certificatePW)
{
// The following code gets the cert from the keystore
var certsInP12 = new X509Certificate2Collection();
certsInP12.Import(certBytes, certificatePW, X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.UserKeySet);
X509Certificate2 certificateToFind = null;
foreach (var c in certsInP12)
{
if (c.FriendlyName == "authentication")
certificateToFind = c;
else if (c.Extensions.OfType<X509KeyUsageExtension>().FirstOrDefault().KeyUsages.HasFlag(X509KeyUsageFlags.NonRepudiation))
certificateToFind = c;
}
if (certificateToFind == null)
{
certificateToFind = new X509Certificate2(certBytes, certificatePW, X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.MachineKeySet);
}
return certificateToFind;
}
So I DO have to get the PrivateKey and to do some processing. I guess I could use terminal and some ssl commands but I was wondering if I can use something that XOJO has so that I don’t reinvent the wheel .
Thanks in advance