1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 01:29:38 +02:00

Add support for XEP-0418: DNS Queries over XMPP (DoX)

Fixes SMACK-862.
This commit is contained in:
Florian Schmaus 2019-04-08 23:09:12 +02:00
parent 75b1d8ce13
commit 62fd897cf7
20 changed files with 564 additions and 6 deletions

View file

@ -43,4 +43,8 @@ public class RandomUtil {
public static int nextSecureRandomInt(int bound) {
return SECURE_RANDOM.get().nextInt(bound);
}
public static int nextSecureRandomInt() {
return SECURE_RANDOM.get().nextInt();
}
}

View file

@ -39,18 +39,17 @@ public class Base64 {
}
public static final String encodeToString(byte[] input) {
byte[] bytes = encode(input);
try {
return new String(bytes, StringUtils.USASCII);
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
return base64encoder.encodeToString(input);
}
public static final String encodeToString(byte[] input, int offset, int len) {
return encodeToString(slice(input, offset, len));
}
public static final String encodeToStringWithoutPadding(byte[] input) {
return base64encoder.encodeToStringWithoutPadding(input);
}
public static final byte[] encode(byte[] input) {
return base64encoder.encode(input);
}
@ -103,6 +102,8 @@ public class Base64 {
String encodeToString(byte[] input);
String encodeToStringWithoutPadding(byte[] input);
byte[] encode(byte[] input);
}
}

View file

@ -39,6 +39,11 @@ public class SmackTestSuite {
return Base64.getEncoder().encodeToString(input);
}
@Override
public String encodeToStringWithoutPadding(byte[] input) {
return Base64.getEncoder().withoutPadding().encodeToString(input);
}
@Override
public byte[] encode(byte[] input) {
return Base64.getEncoder().encode(input);