Пример #1
0
        public void Constructor(messagebroker.MessageBroker Broker)
        {
            this.broker = Broker;
            this.FindGnuPG("");
            this.gpg               = new GnuPGWrapper();
            this.gpghomepath       = Util.getApplicationPath() + Path.DirectorySeparatorChar + "gnupg";
            this.gpg.homedirectory = this.gpghomepath.Replace("file:\\", "");
            this.gpg.bindirectory  = this.gpgpath.Replace("file:\\", "");
            if (!Directory.Exists(this.gpghomepath))
            {
                Directory.CreateDirectory(this.gpghomepath.Replace("file:\\", ""));
            }
            // Find key id for UUID@Hostname
            this.gpg.command   = Commands.FindKey;
            this.gpg.arguments = this.broker.UUID + "@" + this.broker.Hostname;
            string outputtext = "";
            string keyid      = "";

            try
            {
                this.gpg.ExecuteCommand("", out outputtext);
                Util.log(this.ToString(), 99, outputtext);
            }
            // If keyid does not exist
            catch (GnuPGException ex)
            {
                // generate host key
            }
            // Save keyid for later
            // Download any new information for keyid from pgp.mit.edu
            // Send keyid to pgp.mit.edu (if anything needs to be sent)
            // Use keyid to sign messages from now on.
            //
        }
Пример #2
0
 public void Constructor(messagebroker.MessageBroker Broker)
 {
     this.broker = Broker;
     this.FindGnuPG("");
     this.gpg = new GnuPGWrapper();
     this.gpghomepath = Util.getApplicationPath() + Path.DirectorySeparatorChar + "gnupg";
     this.gpg.homedirectory = this.gpghomepath.Replace("file:\\","");
     this.gpg.bindirectory = this.gpgpath.Replace("file:\\","");
     if (!Directory.Exists(this.gpghomepath)) {
         Directory.CreateDirectory(this.gpghomepath.Replace("file:\\", ""));
     }
     // Find key id for UUID@Hostname
     this.gpg.command = Commands.FindKey;
     this.gpg.arguments = this.broker.UUID + "@" + this.broker.Hostname;
     string outputtext = "";
     string keyid = "";
     try
     {
         this.gpg.ExecuteCommand("", out outputtext);
         Util.log(this.ToString(), 99, outputtext);
     }
     // If keyid does not exist
     catch(GnuPGException ex)
     {
         // generate host key
     }
     // Save keyid for later
     // Download any new information for keyid from pgp.mit.edu
     // Send keyid to pgp.mit.edu (if anything needs to be sent)
     // Use keyid to sign messages from now on.
     //
 }
Пример #3
0
 public Manager(messagebroker.MessageBroker Broker)
 {
     Util.log(this.ToString(), 99, "Run Path: " + Util.getApplicationPath());
     this.Constructor(Broker);
 }