in src/main/java/org/apache/maven/shared/jarsigner/JarSignerUtil.java [75:105]
public static void unsignArchive(File jarFile) throws IOException {
File unsignedFile = new File(jarFile.getAbsolutePath() + ".unsigned");
try (ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(jarFile)));
ZipOutputStream zos =
new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(unsignedFile)))) {
for (ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) {
if (isSignatureFile(ze.getName())) {
continue;
}
zos.putNextEntry(new ZipEntry(ze.getName()));
if (isManifestFile(ze.getName())) {
// build a new manifest while removing all digest entries
// see https://jira.codehaus.org/browse/MSHARED-314
Manifest oldManifest = new Manifest(zis);
Manifest newManifest = buildUnsignedManifest(oldManifest);
newManifest.write(zos);
continue;
}
IOUtil.copy(zis, zos);
}
}
FileUtils.rename(unsignedFile, jarFile);
}