Tamir.SharpSsh.jsch.JSch.setHostKeyRepository C# (CSharp) Method

setHostKeyRepository() public method

public setHostKeyRepository ( Tamir.SharpSsh.jsch.HostKeyRepository foo ) : void
foo Tamir.SharpSsh.jsch.HostKeyRepository
return void
		public void setHostKeyRepository(HostKeyRepository foo)
		{
			known_hosts=foo;
		}
		public void setKnownHosts(String foo) 

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Obtain the JSch used to create new sessions.
        /// </summary>
        /// <param name="hc">host configuration</param>
        /// <returns>the JSch instance to use.</returns>
        protected JSch getJSch(OpenSshConfig.Host hc)
        {
            if (hc == null)
                throw new System.ArgumentNullException("hc");

            JSch def = getDefaultJSch();
            FileInfo identityFile = hc.getIdentityFile();
            if (identityFile == null)
                return def;

            string identityKey = identityFile.FullName;
            JSch jsch;
            if(!_byIdentityFile.TryGetValue(identityKey, out jsch))
            {
                jsch = new JSch();
                jsch.setHostKeyRepository(def.getHostKeyRepository());
                jsch.addIdentity(identityKey);
                _byIdentityFile.Add(identityKey, jsch);
            }
            return jsch;
        }
All Usage Examples Of Tamir.SharpSsh.jsch.JSch::setHostKeyRepository