diff options
Diffstat (limited to 'eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/builder/BpkBuilder.java')
-rw-r--r-- | eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/builder/BpkBuilder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/builder/BpkBuilder.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/builder/BpkBuilder.java index 903aa300..cf26694c 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/builder/BpkBuilder.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/builder/BpkBuilder.java @@ -24,6 +24,7 @@ import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; import java.text.SimpleDateFormat; +import java.util.Base64; import java.util.Date; import java.util.Map.Entry; @@ -36,7 +37,6 @@ import javax.crypto.NoSuchPaddingException; import org.apache.commons.lang3.StringUtils; import org.springframework.lang.Nullable; import org.springframework.util.Assert; -import org.springframework.util.Base64Utils; import at.gv.egiz.eaaf.core.api.data.EaafConstants; import at.gv.egiz.eaaf.core.exceptions.EaafBuilderException; @@ -190,7 +190,7 @@ public class BpkBuilder { try { final byte[] inputBytes = input.getBytes("ISO-8859-1"); result = encrypt(inputBytes, publicKey); - return new String(Base64Utils.encode(result), "ISO-8859-1").replaceAll("\r\n", ""); + return new String(Base64.getEncoder().encode(result), "ISO-8859-1").replaceAll("\r\n", ""); // return new String(Base64Utils.encode(result, // "ISO-8859-1")).replaceAll("\r\n", ""); @@ -221,7 +221,7 @@ public class BpkBuilder { } try { - final byte[] encryptedBytes = Base64Utils.decode(encryptedBpk.getBytes("ISO-8859-1")); + final byte[] encryptedBytes = Base64.getDecoder().decode(encryptedBpk.getBytes("ISO-8859-1")); final byte[] decryptedBytes = decrypt(encryptedBytes, privateKey); decryptedString = new String(decryptedBytes, "ISO-8859-1"); @@ -398,7 +398,7 @@ public class BpkBuilder { final MessageDigest md = MessageDigest.getInstance("SHA-1"); final byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1")); final String hashBase64 = - new String(Base64Utils.encode(hash), "ISO-8859-1").replaceAll("\r\n", ""); // Base64Utils.encode(hash); + new String(Base64.getEncoder().encode(hash), "ISO-8859-1").replaceAll("\r\n", ""); return hashBase64; } catch (final Exception ex) { |