• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • Buy SSL Certificates
  • Blog
  • OpenSSL
  • Keytool
  • SSL Tools
  • Donate

Java Invalid Signature File

June 2, 2022 by Mister PKI Leave a Comment

The purpose of this article is to explain the Java Invalid Signature File error you may encounter when running a java jar file. When building a jar file that contains other jar files with standard build tools you should not encounter this error. However, you may encounter the error when using the maven shade plugin.

The specific error condition is the following:

java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

This means that you have packaged a signed jar file inside of another jar file. The solution is to exclude the signature files. In your maven shade plugin configuration, add the following.

<configuration>
    <filters>
        <filter>
            <artifact>*:*</artifact>
            <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
            </excludes>
        </filter>
    </filters>
    <!-- Additional configuration. -->
</configuration>

Now you should be able to rebuild your jar file and it will run successfully, without the error.

Conclusion

This article has demonstrated how to recover from a Java invalid signature error when executing a jar file. Leave us a comment with any questions. Be sure to read some of our other posts!

java

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

Buy SSL Certificates

The SSL Store

Comodo Store

Sectigo Store

RapidSSL

Recent Posts

  • Proxy Addresses Active Directory
  • Windows Private Key Permissions
  • Install .NET 3.5 on Windows Server 2019
  • Netscaler SSL Redirect
  • How to mount NFS share on Linux

Footer

  • Twitter
  • YouTube

Pages

  • About Mister PKI
  • Blog
  • Compare and Buy Affordable PKI Certificates
  • Contact Us
  • Full Disclosure
  • Privacy Policy
  • SSL Tools – Certificate Decoder and Certificate Checker

Copyright © 2023