Ignore:
Timestamp:
Jan 15, 2011, 10:32:51 PM (11 years ago)
Author:
kopal
Message:
  • removed old certificate stuff
  • p2p editor now checks if certificate exists and can be loaded BEFORE trying to connect to network
  • p2p password is now encrypted using the current windows user
  • some design changes of p2p editor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypP2P/Internal/ConnectionManager.cs

    r2276 r2348  
    2020using Cryptool.P2P.Worker;
    2121using Cryptool.PluginBase;
     22using PeersAtPlay.CertificateLibrary.Certificates;
     23using System.IO;
    2224
    2325namespace Cryptool.P2P.Internal
     
    9395            }
    9496        }
    95 
     97       
    9698        public void Connect()
    9799        {
     
    100102                disconnected = false;
    101103                lastConnectionAttempt = DateTime.Now;
     104
     105                try
     106                {
     107                    if (CertificateServices.GetPeerCertificateByAvatar(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "PeersAtPlay" + Path.DirectorySeparatorChar + "Certificates" + Path.DirectorySeparatorChar),
     108                        P2PSettings.Default.PeerName, P2PSettings.Default.Password) == null)
     109                    {
     110                        P2PManager.GuiLogMessage("Cannot connect, account \"" + P2PSettings.Default.PeerName + "\" not found!",
     111                                                 NotificationLevel.Warning);
     112                        return;
     113                    }
     114                }
     115                catch (Exception ex)
     116                {
     117                    P2PManager.GuiLogMessage("Cannot connect using account \"" + P2PSettings.Default.PeerName + "\": " + (ex.InnerException != null ? ex.InnerException.Message : ex.Message),
     118                                                 NotificationLevel.Warning);
     119                    return;
     120                }
    102121
    103122                if (p2PBase.IsConnected || IsConnecting)
Note: See TracChangeset for help on using the changeset viewer.