本文整理匯總了C#中Tamir.SharpSsh.jsch.Session.getConfig方法的典型用法代碼示例。如果您正苦於以下問題:C# Session.getConfig方法的具體用法?C# Session.getConfig怎麽用?C# Session.getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tamir.SharpSsh.jsch.Session
的用法示例。
在下文中一共展示了Session.getConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: init
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;
}
示例2: init
//private byte[] f;
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 e)
{
Console.WriteLine(e);
}
buf = new Buffer();
packet = new Packet(buf);
try
{
Type t = Type.GetType(session.getConfig("dh"));
dh = (DH) (Activator.CreateInstance(t));
dh.init();
}
catch (Exception e)
{
throw e;
}
packet.reset();
buf.putByte(0x22);
buf.putInt(min);
buf.putInt(preferred);
buf.putInt(max);
session.write(packet);
state = SSH_MSG_KEX_DH_GEX_GROUP;
}