This commit is contained in:
2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
using System.Security.Cryptography.X509Certificates;
namespace Kreta.EESZTInterface
{
public class CertificateHelper
{
private static readonly string binPath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "bin");
public static X509Certificate2 GetSslCertificate()
{
return new X509Certificate2($@"{binPath}\Certs\eKRETA_prod.pfx", "9e=EH!2q");
}
public static X509Certificate2 GetSTSCertificate()
{
return new X509Certificate2($@"{binPath}\Certs\p_owsm.cer");
}
public static X509Certificate2 GetUserCertificate()
{
return new X509Certificate2($@"{binPath}.\Certs\userEles.pfx", "eKretaBudafoki");
}
public static string CertToBase64String(X509Certificate2 cert)
{
return System.Convert.ToBase64String(cert.RawData);
}
public static X509Certificate2 CertFromBase64String(string base64Encoded)
{
byte[] data = System.Convert.FromBase64String(base64Encoded);
var cert = new X509Certificate2(data);
return cert;
}
}
}