本文整理了Java中com.sun.mail.auth.Ntlm.copybytes()
方法的一些代码示例,展示了Ntlm.copybytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ntlm.copybytes()
方法的具体详情如下:
包路径:com.sun.mail.auth.Ntlm
类名称:Ntlm
方法名:copybytes
暂无
代码示例来源: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
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源:origin: camunda/camunda-bpm-platform
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源: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
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源:origin: com.sun.mail/jakarta.mail
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源:origin: org.glassfish.metro/webservices-extra
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源:origin: com.sun.mail/android-mail
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源:origin: com.sun.mail/mailapi
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
代码示例来源:origin: jboss/jboss-javaee-specs
copybytes(type3, l, ntdomain, "UnicodeLittleUnmarked");
type3[32] = (byte) (l % 256);
type3[33] = (byte) (l / 256);
l += dlen;
copybytes(type3, l, username, "UnicodeLittleUnmarked");
type3[40] = (byte) (l % 256);
type3[41] = (byte) (l / 256);
l += ulen;
copybytes(type3, l, hostname, "UnicodeLittleUnmarked");
type3[48] = (byte) (l % 256);
type3[49] = (byte) (l / 256);
内容来源于网络,如有侵权,请联系作者删除!