org.apache.sshd.common.util.buffer.Buffer.toHex()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(194)

本文整理了Java中org.apache.sshd.common.util.buffer.Buffer.toHex()方法的一些代码示例,展示了Buffer.toHex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.toHex()方法的具体详情如下:
包路径:org.apache.sshd.common.util.buffer.Buffer
类名称:Buffer
方法名:toHex

Buffer.toHex介绍

暂无

代码示例

代码示例来源:origin: org.apache.sshd/sshd-osgi

protected boolean verifySignature(
    ServerSession session, String username, String alg, PublicKey key, Buffer buffer, Signature verifier, byte[] sig)
      throws Exception {
  byte[] id = session.getSessionId();
  String service = getService();
  String name = getName();
  Buffer buf = new ByteArrayBuffer(id.length + username.length() + service.length() + name.length()
    + alg.length() + ByteArrayBuffer.DEFAULT_SIZE + Long.SIZE, false);
  buf.putBytes(id);
  buf.putByte(SshConstants.SSH_MSG_USERAUTH_REQUEST);
  buf.putString(username);
  buf.putString(service);
  buf.putString(name);
  buf.putBoolean(true);
  buf.putString(alg);
  buf.putBuffer(buffer);
  if (log.isTraceEnabled()) {
    log.trace("verifySignature({}@{})[{}][{}] key type={}, fingerprint={} - verification data={}",
       username, session, service, name, alg, KeyUtils.getFingerPrint(key), buf.toHex());
    log.trace("verifySignature({}@{})[{}][{}] key type={}, fingerprint={} - expected signature={}",
       username, session, service, name, alg, KeyUtils.getFingerPrint(key), BufferUtils.toHex(sig));
  }
  verifier.update(buf.array(), buf.rpos(), buf.available());
  return verifier.verify(sig);
}

代码示例来源:origin: org.apache.sshd/sshd-core

protected boolean verifySignature(
    ServerSession session, String username, String alg, PublicKey key, Buffer buffer, Signature verifier, byte[] sig)
      throws Exception {
  byte[] id = session.getSessionId();
  String service = getService();
  String name = getName();
  Buffer buf = new ByteArrayBuffer(id.length + username.length() + service.length() + name.length()
    + alg.length() + ByteArrayBuffer.DEFAULT_SIZE + Long.SIZE, false);
  buf.putBytes(id);
  buf.putByte(SshConstants.SSH_MSG_USERAUTH_REQUEST);
  buf.putString(username);
  buf.putString(service);
  buf.putString(name);
  buf.putBoolean(true);
  buf.putString(alg);
  buf.putBuffer(buffer);
  if (log.isTraceEnabled()) {
    log.trace("verifySignature({}@{})[{}][{}] key type={}, fingerprint={} - verification data={}",
       username, session, service, name, alg, KeyUtils.getFingerPrint(key), buf.toHex());
    log.trace("verifySignature({}@{})[{}][{}] key type={}, fingerprint={} - expected signature={}",
       username, session, service, name, alg, KeyUtils.getFingerPrint(key), BufferUtils.toHex(sig));
  }
  verifier.update(buf.array(), buf.rpos(), buf.available());
  return verifier.verify(sig);
}

代码示例来源:origin: org.apache.sshd/sshd-osgi

log.trace("doAuth({}@{}) key type={}, fingerprint={}, client={}@{}, num-certs={} - verification data: {}",
     username, session, keyType, KeyUtils.getFingerPrint(clientKey),
     clientUsername, clientHostName, GenericUtils.size(certs), buf.toHex());
log.trace("doAuth({}@{}) key type={}, fingerprint={}, client={}@{}, num-certs={} - expected signature: {}",
    username, session, keyType, KeyUtils.getFingerPrint(clientKey),

代码示例来源:origin: org.apache.sshd/sshd-core

log.trace("doAuth({}@{}) key type={}, fingerprint={}, client={}@{}, num-certs={} - verification data: {}",
     username, session, keyType, KeyUtils.getFingerPrint(clientKey),
     clientUsername, clientHostName, GenericUtils.size(certs), buf.toHex());
log.trace("doAuth({}@{}) key type={}, fingerprint={}, client={}@{}, num-certs={} - expected signature: {}",
    username, session, keyType, KeyUtils.getFingerPrint(clientKey),

相关文章