I want to know if Netbeans has some option or setting that will allow me to automatically sign a jar as part of the build.
Digitally sign JARs with jarsignerCreate a JAR file with Java's JAR utility. Create public and private keys with Java's keytool. Export the server-side digital certificate with the keytool. Use the jarsigner tool to sign the JAR file digitally.
In the case of signed JAR files, the certificate indicates who owns the public key contained in the JAR file. When you sign a JAR file your public key is placed inside the archive along with an associated certificate so that it's easily available for use by anyone wanting to verify your signature.
In your -post-jar
ant target, it may be convenient to read the <signjar> password from a file, e.g. ~/.keyconf. Give the file user-only access: e.g. 400
or 600
.
<loadfile srcfile="${user.home}/.keyconf" property="keyconf"/>
<signjar alias="..." storepass="${keyconf}">
...
</signjar>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With