summaryrefslogtreecommitdiffstats
path: root/security-utils/src/main/java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-10-25 15:07:48 +0200
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-10-25 15:07:48 +0200
commit9b883fa23c8be0279c94d8d0b21c6058ee7e6bd0 (patch)
treed9cea17fcf58c3125d26b9edf19aa536e83bba66 /security-utils/src/main/java
parent2dc4c6b58004d51af887c49760a98804803ab73f (diff)
Use JDK17's own hex utilities instead of BouncyCastle's
Diffstat (limited to 'security-utils/src/main/java')
-rw-r--r--security-utils/src/main/java/com/yahoo/security/ArrayUtils.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java b/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java
index 41f19d5c82c..476b2e27048 100644
--- a/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java
+++ b/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java
@@ -1,9 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.security;
-import org.bouncycastle.util.encoders.Hex;
-
import java.nio.charset.StandardCharsets;
+import java.util.HexFormat;
/**
* A small collection of utils for working on arrays of bytes.
@@ -32,11 +31,11 @@ public class ArrayUtils {
}
public static byte[] unhex(String hexStr) {
- return Hex.decode(hexStr);
+ return HexFormat.of().parseHex(hexStr);
}
public static String hex(byte[] bytes) {
- return Hex.toHexString(bytes);
+ return HexFormat.of().formatHex(bytes);
}
public static byte[] toUtf8Bytes(String str) {