com.sun.mail.auth.Ntlm.toHex()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(106)

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

Ntlm.toHex介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: com.sun.mail/javax.mail

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: com.sun.mail/javax.mail

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

代码示例来源:origin: camunda/camunda-bpm-platform

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

代码示例来源:origin: javax.mail/com.springsource.javax.mail

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (debugout != null)
  debugout.println("DEBUG NTLM: type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: com.sun.mail/jakarta.mail

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: com.sun.mail/android-mail

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: com.sun.mail/mailapi

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: jboss/jboss-javaee-specs

public String generateType1Msg(int flags) {
// XXX - should set "flags" in generated message
  int dlen = ntdomain.length();
  type1[16]= (byte) (dlen % 256);
  type1[17]= (byte) (dlen / 256);
  type1[18] = type1[16];
  type1[19] = type1[17];
if (dlen == 0)
  type1[13] &= ~0x10;
  int hlen = hostname.length();
  type1[24]= (byte) (hlen % 256);
  type1[25]= (byte) (hlen / 256);
  type1[26] = type1[24];
  type1[27] = type1[25];
  copybytes(type1, 32, hostname, "iso-8859-1");
  copybytes(type1, hlen+32, ntdomain, "iso-8859-1");
  type1[20] = (byte) ((hlen+32) % 256);
  type1[21] = (byte) ((hlen+32) / 256);
  byte[] msg = new byte[32 + hlen + dlen];
  System.arraycopy(type1, 0, msg, 0, 32 + hlen + dlen);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 1 message: " + toHex(msg));
  String result = null;
try {
  result = new String(BASE64EncoderStream.encode(msg), "iso-8859-1");
  } catch (UnsupportedEncodingException e) {
    assert false;
  }
  return result;
}

代码示例来源:origin: javax.mail/com.springsource.javax.mail

System.arraycopy(type3, 0, msg, 0, l);
if (debugout != null)
  debugout.println("DEBUG NTLM: type 3 message: " + toHex(msg));

代码示例来源:origin: com.sun.mail/jakarta.mail

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

代码示例来源:origin: org.glassfish.metro/webservices-extra

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

代码示例来源:origin: com.sun.mail/android-mail

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

代码示例来源:origin: com.sun.mail/mailapi

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

代码示例来源:origin: jboss/jboss-javaee-specs

System.arraycopy(type3, 0, msg, 0, l);
if (logger.isLoggable(Level.FINE))
  logger.fine("type 3 message: " + toHex(msg));

相关文章