After reading swing's Java Web Start learning, I wrote a Java application, so I decided to put my application on the server and use the Java Web Start technology to make it easier for others to use.
1. keystore Validity PeriodKeytool-genkey-keystore mykeystore-alias same stest-validity 365
Set with-validity valdays. The default value is 6 months.
2. Sign JAR FileJarsigner-keystore mykeystore-storepass XXXX yourtest. Jar using stest
Directly use storepass to pass the password to jarsigner. You do not need to enter the password separately each time. It is suitable for batch processing. Sign multiple jar files together. Because JWS is used, sign is required for referenced jar files.
3. referenced jar that has been signed by someone else
Exception may occur if no special processing is performed.Jar resources in JNLP file are not signed by same certificate
Run the-verfiy command to verify that the jar has been signed.Jarsigner-Certs-verbose-verify yourtest. Jar
Generally, the solution is to write the signed JAR into a separate JNLP, and then reference it in the primary JNLP. <? XML version = "1.0" encoding = "UTF-8"?>
<JNLP spec = "1.0 +" codebase = "http: // localhost: 8080/WebStart/" href = "signedjar. JNLP">
<Information>
<Title> signed JAR </title>
<Vendor> ABC Company </vendor>
<Offline-allowed/>
</Information>
<Offline-allowed/>
<Resources>
<Jar href = "signed. Jar"/>
</Resources>
<Component-Desc/>
</JNLP>
<Resources>
<J2se version = "1.5 +"/>
<Jar href = "jaxbw. Jar"/>
<Jar href = "substance. Jar"/>
<Jar href = "jaxb-api.jar"/>
<Jar href = "jaxb-impl.jar"/>
<Jar href = "jaxb-xjc.jar"/>
<Jar href = "jsr173_api.jar"/>
<Extension name = "signedjar" href = "signedjar. JNLP"/>
</Resources>