private static boolean removeDigestAttributes(Manifest manifest) {
boolean foundDigestAttribute = false;
for (Map.Entry<String, Attributes> entry : manifest.getEntries().entrySet()) {
Attributes attributes = entry.getValue();
for (Object attributeName : attributes.keySet()) {
String name = ((Attributes.Name) attributeName).toString();
name = name.toLowerCase();
if (name.endsWith("-digest") || name.contains("-digest-")) {
attributes.remove(attributeName);
foundDigestAttribute = true;