Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 4
0
 public MainWindow()
 {
     InitializeComponent();
     CryptoProvider = new VipNetCrytoProvider();
     textBox1.Text  = XDocument.Parse(Xml).ToString();
 }