Update to latest refactored bndlib
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1362033 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/libg/cryptography/Digest.java b/bundleplugin/src/main/java/aQute/libg/cryptography/Digest.java
index 93d48ad..aeb4bbb 100644
--- a/bundleplugin/src/main/java/aQute/libg/cryptography/Digest.java
+++ b/bundleplugin/src/main/java/aQute/libg/cryptography/Digest.java
@@ -17,6 +17,10 @@
return digest;
}
+ public String asHex() {
+ return Hex.toHexString(digest());
+ }
+
@Override
public String toString() {
return String.format("%s(d=%s)", getAlgorithm(), Hex.toHexString(digest));
diff --git a/bundleplugin/src/main/java/aQute/libg/cryptography/MD5.java b/bundleplugin/src/main/java/aQute/libg/cryptography/MD5.java
index 05a6bdd..a1a5a0a 100644
--- a/bundleplugin/src/main/java/aQute/libg/cryptography/MD5.java
+++ b/bundleplugin/src/main/java/aQute/libg/cryptography/MD5.java
@@ -35,4 +35,7 @@
return ALGORITHM;
}
+ public static MD5 digest(byte [] data) throws Exception {
+ return getDigester().digest(data);
+ }
}
\ No newline at end of file
diff --git a/bundleplugin/src/main/java/aQute/libg/cryptography/SHA1.java b/bundleplugin/src/main/java/aQute/libg/cryptography/SHA1.java
index d0a486c..c76f182 100644
--- a/bundleplugin/src/main/java/aQute/libg/cryptography/SHA1.java
+++ b/bundleplugin/src/main/java/aQute/libg/cryptography/SHA1.java
@@ -35,4 +35,7 @@
return ALGORITHM;
}
+ public static SHA1 digest(byte [] data) throws Exception {
+ return getDigester().digest(data);
+ }
}
\ No newline at end of file
diff --git a/bundleplugin/src/main/java/aQute/libg/cryptography/SHA256.java b/bundleplugin/src/main/java/aQute/libg/cryptography/SHA256.java
index b6eeacc..743a431 100644
--- a/bundleplugin/src/main/java/aQute/libg/cryptography/SHA256.java
+++ b/bundleplugin/src/main/java/aQute/libg/cryptography/SHA256.java
@@ -35,4 +35,7 @@
return ALGORITHM;
}
+ public static SHA256 digest(byte [] data) throws Exception {
+ return getDigester().digest(data);
+ }
}
\ No newline at end of file