public string doDecrypt(string encryptedData, string certPath, string password) { string clearData = ""; if (System.IO.File.Exists(certPath)) { try { clearData = myPKCS7.decryptMessage(encryptedData, myPKCS7.getPrivateCert(certPath, password)); } catch (Exception ex) { } } else { clearData = "'" + certPath + "' does not exists."; } return(clearData); }