39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
package org.jivesoftware.smackx.util;
|
|
|
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
|
import org.jivesoftware.smack.SmackConfiguration;
|
|
import org.jivesoftware.smack.util.stringencoder.Base64;
|
|
|
|
import java.security.Security;
|
|
|
|
public class MercurySmackTestSuite {
|
|
static {
|
|
SmackConfiguration.getVersion();
|
|
org.jivesoftware.smack.util.stringencoder.Base64.setEncoder(new Base64.Encoder() {
|
|
|
|
@Override
|
|
public byte[] decode(String string) {
|
|
return java.util.Base64.getDecoder().decode(string);
|
|
}
|
|
|
|
@Override
|
|
public String encodeToString(byte[] input) {
|
|
return java.util.Base64.getEncoder().encodeToString(input);
|
|
}
|
|
|
|
@Override
|
|
public String encodeToStringWithoutPadding(byte[] input) {
|
|
return java.util.Base64.getEncoder().withoutPadding().encodeToString(input);
|
|
}
|
|
|
|
@Override
|
|
public byte[] encode(byte[] input) {
|
|
return java.util.Base64.getEncoder().encode(input);
|
|
}
|
|
|
|
});
|
|
|
|
Security.addProvider(new BouncyCastleProvider());
|
|
}
|
|
}
|