public Service1() { ConfigPath = "C:\\Work\\XmlSign\\trunk\\WcfXmlSigningService\\bin\\Service.cfg"; using (var file = File.OpenText(ConfigPath)) { var containerPath = file.ReadLine(); var password = file.ReadLine(); CrytoProvider = new VipNetCrytoProvider(containerPath, password); } }
public XmlSignService() { ErrorMessage = ""; try { var configPath = AppDomain.CurrentDomain.BaseDirectory + "config.txt"; using (var file = File.OpenText(configPath)) { CrytoProvider = new VipNetCrytoProvider(containerPath: file.ReadLine(), password: file.ReadLine()); } } catch (Exception exception) { ErrorMessage = exception.Message + "\n" + exception.StackTrace; } }
static void Main(string[] args) { try { if (args.Length > 1) { var provider = new VipNetCrytoProvider(args[0], args[1]); var xml = ""; using (var file = File.OpenText("input.txt")) { xml = file.ReadToEnd(); } var doc = new SignedXmlDocument(xml); provider.SignDocument(doc); Console.WriteLine(doc.ToString()); } } catch (Exception exc) { Console.WriteLine(exc.Message); Console.ReadKey(); //throw; } }
public MainWindow() { InitializeComponent(); CryptoProvider = new VipNetCrytoProvider(); textBox1.Text = XDocument.Parse(Xml).ToString(); }