protected override string ExecuteWorkflow(X509Certificate2 candidate) { var oidValue = OidHelper.GetOidValue(candidate, OidHelper.Personal); if (oidValue != null) { return(oidValue.Substring(8, 11)); } oidValue = OidHelper.GetOidValue(candidate, OidHelper.Company); if (oidValue != null) { return(oidValue.Substring(8, 11)); } return(oidValue); }
protected override DateTime ExecuteWorkflow(X509Certificate2 candidate) { var dateString = default(string); var oidValue = OidHelper.GetOidValue(candidate, OidHelper.Personal); if (oidValue != null) { dateString = oidValue.Substring(0, 8); } oidValue = OidHelper.GetOidValue(candidate, OidHelper.Company); if (oidValue != null) { dateString = oidValue.Substring(0, 8); } dateString = dateString.Insert(2, "/"); dateString = dateString.Insert(5, "/"); return(DateTime.ParseExact(dateString, "dd/MM/yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("pt-BR"))); }