Sign a JAR file with a specific algorithm

jarsigner

  • Sign and verify Java archive (JAR) files.
    More information: <https://docs.oracle.com/javase/9/tools/jarsigner.htm>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

jarsigner -sigalg {{algorithm}} {{path/to/file.jar}} {{keystore_alias}}

click the source code to copy install jarsigner on any operating system with command-not-found.com