Beispiel #1
0
        private string GetStore()
        {
            // Valida contra OCSP
            string   Store       = string.Empty;
            DateTime expiracion  = DateTime.Parse(Certificado.GetEffectiveDateString());
            int      añoGenerado = expiracion.Year;
            int      mesGenerado = expiracion.Month + 1;
            int      diaGenerado = expiracion.Day;

            if (añoGenerado >= 2012)
            {
                if (expiracion > DateTime.Parse("25/05/2019"))
                {
                    Store = CERT_STORE_2019;
                }
                else if (expiracion > DateTime.Parse("18/07/2015"))
                {
                    //if (expiracion < DateTime.Parse("01/01/2017"))
                    Store = CERT_STORE_2015;
                    //else Store = CERT_STORE_2017;
                }
                else if (añoGenerado >= 2014)
                {
                    Store = CERT_STORE_2013;
                }
                else if (añoGenerado == 2013 && mesGenerado >= 5)
                {
                    Store = CERT_STORE_2013;
                }
                else
                {
                    Store = CERT_STORE_2012;
                }
            }
            else
            {
                Store = CERT_STORE_2011;
            }
            return(Store);
        }