mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-10-02 16:38:10 +02:00
Removed dependency on javax.xml.bind.Datatypeconverter for Base64
javax.xml was removed in recent Java versions, so depending on it breaks compatibility with servers running on them. The Base64 class is the way to use Base64 serialization.
This commit is contained in:
parent
33da458a0f
commit
adb57c0179
@ -20,7 +20,7 @@ import com.djrapitops.plan.api.exceptions.PassEncryptException;
|
||||
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.util.Base64;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
@ -177,11 +177,11 @@ public class PassEncryptUtil {
|
||||
}
|
||||
|
||||
private static byte[] fromBase64(String hex) {
|
||||
return DatatypeConverter.parseBase64Binary(hex);
|
||||
return Base64.getDecoder().decode(hex);
|
||||
}
|
||||
|
||||
private static String toBase64(byte[] array) {
|
||||
return DatatypeConverter.printBase64Binary(array);
|
||||
return Base64.getEncoder().encodeToString(array);
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
|
Loading…
Reference in New Issue
Block a user