本文整理汇总了Java中com.trilead.ssh2.crypto.digest.HashForSSH2Types.updateByteString方法的典型用法代码示例。如果您正苦于以下问题:Java HashForSSH2Types.updateByteString方法的具体用法?Java HashForSSH2Types.updateByteString怎么用?Java HashForSSH2Types.updateByteString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.trilead.ssh2.crypto.digest.HashForSSH2Types
的用法示例。
在下文中一共展示了HashForSSH2Types.updateByteString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateH
import com.trilead.ssh2.crypto.digest.HashForSSH2Types; //导入方法依赖的package包/类
public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
byte[] serverKexPayload, byte[] hostKey, DHGexParameters para)
{
HashForSSH2Types hash = new HashForSSH2Types("SHA1");
hash.updateByteString(clientversion);
hash.updateByteString(serverversion);
hash.updateByteString(clientKexPayload);
hash.updateByteString(serverKexPayload);
hash.updateByteString(hostKey);
if (para.getMin_group_len() > 0)
hash.updateUINT32(para.getMin_group_len());
hash.updateUINT32(para.getPref_group_len());
if (para.getMax_group_len() > 0)
hash.updateUINT32(para.getMax_group_len());
hash.updateBigInt(p);
hash.updateBigInt(g);
hash.updateBigInt(e);
hash.updateBigInt(f);
hash.updateBigInt(k);
return hash.getDigest();
}
示例2: calculateH
import com.trilead.ssh2.crypto.digest.HashForSSH2Types; //导入方法依赖的package包/类
public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
byte[] serverKexPayload, byte[] hostKey) throws UnsupportedEncodingException
{
HashForSSH2Types hash = new HashForSSH2Types("SHA1");
if (log.isEnabled())
{
log.log(90, "Client: '" + new String(clientversion, "ISO-8859-1") + "'");
log.log(90, "Server: '" + new String(serverversion, "ISO-8859-1") + "'");
}
hash.updateByteString(clientversion);
hash.updateByteString(serverversion);
hash.updateByteString(clientKexPayload);
hash.updateByteString(serverKexPayload);
hash.updateByteString(hostKey);
hash.updateBigInt(e);
hash.updateBigInt(f);
hash.updateBigInt(k);
return hash.getDigest();
}
示例3: calculateH
import com.trilead.ssh2.crypto.digest.HashForSSH2Types; //导入方法依赖的package包/类
public byte[] calculateH(byte[] clientversion, byte[] serverversion,
byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey)
throws UnsupportedEncodingException {
HashForSSH2Types hash = new HashForSSH2Types("SHA1");
if (log.isEnabled()) {
log.log(90, "Client: '" + new String(clientversion, "ISO-8859-1")
+ "'");
log.log(90, "Server: '" + new String(serverversion, "ISO-8859-1")
+ "'");
}
hash.updateByteString(clientversion);
hash.updateByteString(serverversion);
hash.updateByteString(clientKexPayload);
hash.updateByteString(serverKexPayload);
hash.updateByteString(hostKey);
hash.updateBigInt(e);
hash.updateBigInt(f);
hash.updateBigInt(k);
return hash.getDigest();
}
示例4: calculateH
import com.trilead.ssh2.crypto.digest.HashForSSH2Types; //导入方法依赖的package包/类
public byte[] calculateH(byte[] clientversion, byte[] serverversion,
byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey,
DHGexParameters para) {
HashForSSH2Types hash = new HashForSSH2Types("SHA1");
hash.updateByteString(clientversion);
hash.updateByteString(serverversion);
hash.updateByteString(clientKexPayload);
hash.updateByteString(serverKexPayload);
hash.updateByteString(hostKey);
if (para.getMin_group_len() > 0)
hash.updateUINT32(para.getMin_group_len());
hash.updateUINT32(para.getPref_group_len());
if (para.getMax_group_len() > 0)
hash.updateUINT32(para.getMax_group_len());
hash.updateBigInt(p);
hash.updateBigInt(g);
hash.updateBigInt(e);
hash.updateBigInt(f);
hash.updateBigInt(k);
return hash.getDigest();
}