Provides data for the HostKeyReceived event.
Inheritance: System.EventArgs
Esempio n. 1
0
 public void CanTrustTest()
 {
     KeyHostAlgorithm host = null; // TODO: Initialize to an appropriate value
     HostKeyEventArgs target = new HostKeyEventArgs(host); // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     target.CanTrust = expected;
     actual = target.CanTrust;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Esempio n. 2
0
 private void Session_HostKeyReceived(object sender, HostKeyEventArgs e)
 {
     var handler = HostKeyReceived;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Determines whether the specified host key can be trusted.
        /// </summary>
        /// <param name="host">The host algorithm.</param>
        /// <returns>
        ///   <c>true</c> if the specified host can be trusted; otherwise, <c>false</c>.
        /// </returns>
        protected bool CanTrustHostKey(KeyHostAlgorithm host)
        {
            var args = new HostKeyEventArgs(host);

            if (this.HostKeyReceived != null)
            {
                this.HostKeyReceived(this, args);
            }

            return args.CanTrust;
        }
Esempio n. 4
0
        /// <summary>
        /// Determines whether the specified host key can be trusted.
        /// </summary>
        /// <param name="host">The host algorithm.</param>
        /// <returns>
        /// <c>true</c> if the specified host can be trusted; otherwise, <c>false</c>.
        /// </returns>
        protected bool CanTrustHostKey(KeyHostAlgorithm host)
        {
            var handlers = HostKeyReceived;
            if (handlers != null)
            {
                var args = new HostKeyEventArgs(host);
                handlers(this, args);
                return args.CanTrust;
            }

            return true;
        }
Esempio n. 5
0
 private void sftp_HostKeyReceived(object sender, HostKeyEventArgs e)
 {
     LogDelegate("[SFTP] HostKeyReceived : " + e.HostKeyName + " " + e.HostKey);
 }
Esempio n. 6
0
 private void Session_HostKeyReceived(object sender, HostKeyEventArgs e)
 {
     if (this.HostKeyReceived != null)
     {
         this.HostKeyReceived(this, e);
     }
 }
Esempio n. 7
0
 public void HostKeyEventArgsConstructorTest()
 {
     KeyHostAlgorithm host = null; // TODO: Initialize to an appropriate value
     HostKeyEventArgs target = new HostKeyEventArgs(host);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Esempio n. 8
0
 private void SshClient_HostKeyReceived(object sender, Renci.SshNet.Common.HostKeyEventArgs e)
 {
     Info("Host key fingerprint is: {0} {1}.", e.HostKeyName, BitConverter.ToString(e.FingerPrint).Replace('-', ':').ToLower());
 }
 private void M_Client_HostKeyReceived(object sender, Renci.SshNet.Common.HostKeyEventArgs e)
 {
     e.CanTrust = e.FingerPrint.SequenceEqual(m_fingerprint) ? true : false;
 }
Esempio n. 10
0
 /// <summary>
 /// An event handler called when the host key was received for the current SSH connection.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnSshHostKeyReceived(object sender, HostKeyEventArgs e)
 {
     // Execute the code on the UI thread.
     this.Invoke(() =>
         {
             this.OnHostKeyReceivedInternal(e);
         });
 }
Esempio n. 11
0
 /// <summary>
 /// An action called when receiving the key from the remote host.
 /// </summary>
 /// <param name="args">The arguments.</param>
 private void OnHostKeyReceivedInternal(HostKeyEventArgs args)
 {
     // Call the event handler.
     this.OnHostKeyReceived(this.client.ConnectionInfo, args);
 }
Esempio n. 12
0
 /// <summary>
 /// An event handler called when receiving a key from the remote host.
 /// </summary>
 /// <param name="info">The connection info.</param>
 /// <param name="args">The event arguments.</param>
 protected virtual void OnHostKeyReceived(ConnectionInfo info, HostKeyEventArgs args)
 {
 }
 /// <summary>
 /// An event handler called when receiving a key from the remote host.
 /// </summary>
 /// <param name="info">The connection info.</param>
 /// <param name="args">The event arguments.</param>
 protected override void OnHostKeyReceived(ConnectionInfo info, HostKeyEventArgs args)
 {
     // Log
     this.log.Add(this.config.Api.Log(
         LogEventLevel.Verbose,
         LogEventType.Information,
         "The client connected to the SSH server \'{0}\' received key \'{1}\' of {2} bits. Key: {3}. Fingerprint: {4}.",
         new object[] { info.Host, args.HostKeyName, args.KeyLength, args.HostKey, args.FingerPrint }));
 }
Esempio n. 14
0
 /// <summary>
 /// An event handler called when receiving a key from the remote host.
 /// </summary>
 /// <param name="info">The connection info.</param>
 /// <param name="args">The event arguments.</param>
 protected override void OnHostKeyReceived(ConnectionInfo info, HostKeyEventArgs args)
 {
     // Log
     this.log.Add(this.crawler.Log.Add(
         LogEventLevel.Verbose,
         LogEventType.Information,
         ControlSession.logSource,
         "The client connected to the PlanetLab node \'{0}\' received key \'{1}\' of {2} bits. Key: {3}. Fingerprint: {4}.",
         new object[] { info.Host, args.HostKeyName, args.KeyLength, args.HostKey, args.FingerPrint }));
 }