Tamir.SharpSsh.jsch.Session.getConfig C# (CSharp) Method

getConfig() public method

public getConfig ( object name ) : String
name object
return String
		public String getConfig(object name)
		{
			System.Object foo=null;
			if(config!=null)
			{
				foo = config[name];
				if(foo is String) return (String)foo;
				if(foo is string) return (string)foo;
			}
			foo=jsch.getConfig(name.ToString());
			if(foo is string) return (string)foo;
			if(foo is String) return (String)foo;
			return null;
		}
		//  public Channel getChannel(){ return channel; }

Usage Example

Example #1
0
		public override void init(Session session,
			byte[] V_S, byte[] V_C, byte[] I_S, byte[] I_C) 
		{
			this.session=session;
			this.V_S=V_S;      
			this.V_C=V_C;      
			this.I_S=I_S;      
			this.I_C=I_C;      

			//    sha=new SHA1();
			//    sha.init();
			try
			{
				Type t=Type.GetType(session.getConfig("sha-1"));
				sha=(HASH)(Activator.CreateInstance(t));
				sha.init();
			}
			catch(Exception ee)
			{
				Console.WriteLine(ee);
			}

			buf=new Buffer();
			packet=new Packet(buf);

			try
			{
				Type t=Type.GetType(session.getConfig("dh"));
				dh=(DH)(Activator.CreateInstance(t));
				dh.init();
			}
			catch(Exception ee)
			{
				throw ee;
			}

			dh.setP(p);
			dh.setG(g);

			// The client responds with:
			// byte  SSH_MSG_KEXDH_INIT(30)
			// mpint e <- g^x mod p
			//         x is a random number (1 < x < (p-1)/2)

			e=dh.getE();

			packet.reset();
			buf.putByte((byte)SSH_MSG_KEXDH_INIT);
			buf.putMPInt(e);
			session.write(packet);

			state=SSH_MSG_KEXDH_REPLY;
		}
All Usage Examples Of Tamir.SharpSsh.jsch.Session::getConfig