/// <summary> /// Sets the host key checking rule; defaults to "NoCheck", and only makes sense when combined /// with a "UserInfo" object to capture mismatch-handling decisions from the user. /// </summary> /// <param name="checkingRule">The host-checking behaviour requested</param> public virtual void SetHostKeyCheckingRule(HostKeyCheckType checkingRule) { m_checkType = checkingRule; }
/// <summary> /// Adds a "known fingerprint" for the target host, and enables strict host checking /// </summary> /// <param name="hostFingerprint">The known fingerprint of the target host key</param> public virtual void SetKnownHostFingerprint(string hostFingerprint) { m_jsch.setHostKeyRepository(new SshFingerprintOnlyHostsList(m_host, hostFingerprint)); //the "SshFingerprintOnlyHostsList" does not support saving - "ask" makes no sense. m_checkType = HostKeyCheckType.ForceMatch; }