using System;
using System.Security.Cryptography.X509Certificates;

namespace WireMock.HttpsCertificate;

/// <summary>
/// Only used for NetStandard 1.3
/// </summary>
internal static class PublicCertificateHelper
{
    // 1] Generate using https://www.pluralsight.com/blog/software-development/selfcert-create-a-self-signed-certificate-interactively-gui-or-programmatically-in-net
    // 2] Converted to Base64
    private const string Data = @"MIIQMgIBAzCCD+4GCSqGSIb3DQEHAaCCD98Egg/bMIIP1zCCCogGCSqGSIb3DQEHAaCCCnkEggp1
[encoded data, 5532 characters]
";

    public static X509Certificate2 GetX509Certificate2()
    {
        byte[] data = Convert.FromBase64String(Data);
        return new X509Certificate2(data);
    }
}