using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PkcsApp
{
    public static class CertificateType
    {
        public const string SIG_EP = "SIG_EP";
        public const string SIG_ZEP = "SIG_ZEP";
        public const string AUTH = "AUTH";
        public const string UNKNOWN = "UNKNOWN";
    }

    public static class Config
    {
        public const  string baseAddress = "http://localhost:9001/";
        public const string configFile = "config.ini";
    }


    public static class HelperFunctions
    {
        public static byte[] HexStringToByte(string value)
        {
            return Enumerable.Range(0, value.Length)
                    .Where(x => x % 2 == 0)
                    .Select(x => Convert.ToByte(value.Substring(0, 2), 16))
                    .ToArray();
        }

        public static string RemoveBeginEndCert(string cert)
        {
            return cert.Replace("-----BEGIN CERTIFICATE-----", "").Replace("-----END CERTIFICATE-----", "");
        }
    }

    
}
