Unsigning a signed jar

Hamza Yerlikaya picture Hamza Yerlikaya · Aug 18, 2009 · Viewed 19.4k times · Source

I am using bouncy castle provider for AES encryption. I need to create a fat jar from bc and my jar but as soon as i do it i get Algorithm not found exception. Is it possible to get rid of the sign and create regular jar out of it?

My build process is..

  • i unzip all jars in to my build directory.
  • then remove META-INF directory
  • compile my application
  • jar it using ant

iget the error when i try to use the

SecretKeyFactory.getInstance(algorithm);

algorithm is PBEWITHSHA256AND128BITAES-CBC-BC from bouncy castle.

Answer

martinhans picture martinhans · Sep 17, 2015

To remove the signature from a jar file, remove the META-INF directory from it. A jar file is a zip file so on Linux you can do this:

zip -d file.jar 'META-INF/*.SF' 'META-INF/*.RSA'