public string[] BatchDettaglioCertificato(string[] CertificateBase64) { List <String> retval = new List <string>(); OpenWcfChannel(); string serviceUrl = ConfigurationManager.AppSettings["SERVICE_URL"]; CrlVerificationService clr = new CrlVerificationService(); CrlVerificationService.EsitoVerifica retvalCert = null; byte[] CertificateCAPEM = null; foreach (string certStr in CertificateBase64) { //converto il certificato base64 in binario byte[] CertificateDer = Convert.FromBase64String(certStr); try { retvalCert = clr.VerificaCertificato(CertificateDer, CertificateCAPEM, client); logger.Debug("Verifica cerificato effettuato con successo."); retval.Add(Utils.SerializeObject <DocsPaVO.documento.CertificateInfo>(clr.GetCertificateInfoFromEv(retvalCert))); } catch (Exception e) { logger.Error("Verifica cerificato Errore :" + e.Message + e.StackTrace); //return e.Message; } } return(retval.ToArray()); }
public string ProvaServizioCERT() { string file = Server.MapPath("~") + "\\cert.der"; OpenWcfChannel(); CrlVerificationService clr = new CrlVerificationService(); logger.Debug("Effettuo la verifica certificato"); CrlVerificationService.EsitoVerifica retval = null; try { byte[] ca = new byte[0]; //byte[] cer = new System.Text.ASCIIEncoding().GetBytes(Convert.ToBase64String(System.IO.File.ReadAllBytes(file))); byte[] cer = System.IO.File.ReadAllBytes(file); string b64Cer = Convert.ToBase64String(System.IO.File.ReadAllBytes(file)); retval = clr.VerificaCertificato(cer, ca, client); logger.Debug("Verifica cerificato effettuato."); } catch (Exception e) { logger.Error("Verifica cerificato Errore :" + e.Message + e.StackTrace); return(e.Message); } return(Utils.SerializeObject <CrlVerificationService.EsitoVerifica>(retval)); }
public string DettaglioCertificato(byte[] CertificateDer, byte[] CertificateCAPEM) { OpenWcfChannel(); CrlVerificationService clr = new CrlVerificationService(); CrlVerificationService.EsitoVerifica retval = null; try { retval = clr.VerificaCertificato(CertificateDer, CertificateCAPEM, client); logger.Debug("Verifica cerificato effettuato con successo."); } catch (Exception e) { logger.Error("Verifica cerificato Errore :" + e.Message + e.StackTrace); return(e.Message); } return(Utils.SerializeObject <CrlVerificationService.EsitoVerifica>(retval)); }