Skip to content

Commit 80c5740

Browse files
committed
Replace use of javax.xml.bind.DatatypeConverter
DatatypeConverter was deprecated in Java 9 and has been removed in Java 11. Instead of DatatypeConverter#printHexBinary we use the equivalent method Hex#encodeHexString from the commons-codec library, which we already require anyway (see build.sh).
1 parent 6597352 commit 80c5740

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cc/arduino/plugins/wifi101/certs/WiFi101Certificate.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
import java.util.Date;
3939
import java.util.TimeZone;
4040

41-
import javax.xml.bind.DatatypeConverter;
42-
41+
import org.apache.commons.codec.binary.Hex;
4342
import org.bouncycastle.asn1.ASN1Encodable;
4443
import org.bouncycastle.asn1.ASN1InputStream;
4544
import org.bouncycastle.asn1.ASN1OutputStream;
@@ -103,7 +102,7 @@ public WiFi101Certificate(X509Certificate x509) throws Exception, NoSuchAlgorith
103102
v1Data = v1Res.toByteArray();
104103

105104
byte[] digest = MessageDigest.getInstance("SHA-1").digest(v0Data);
106-
hash = DatatypeConverter.printHexBinary(digest).substring(0, 6);
105+
hash = Hex.encodeHexString(digest).substring(0, 6);
107106
}
108107

109108
@Override

0 commit comments

Comments
 (0)