public class StreamedAutoSignedStaticContent extends AutoSignedContent
This implementation supports the requirement to "sign" a JNLP document by including it in a signed JAR so the Java Web Start client can verify that the JNLP delivered is the correct document (as compared to the copy in the signed JAR delivered to the client).
Most signed JARs served by the Java Web Start support in GlassFish are created on-disk by signing their unsigned counterparts once. Then the on-disk signed JAR is served when the client asks for the JAR. The main JAR has to be handled differently to meet the Java Web start security requirements. The signed copy of the main JAR is created on-the-fly by signing the unsigned JAR's contents plus the previously-generated JNLP. The signed output is sent directly to the HTTP response's output stream rather than creating a temporary file.
We cannot create the signed main JAR once and for all because the JNLP
document which launches the app might change from one invocation to the next,
particularly regarding command-line arguments which appear in the JNLP as
Content.Adapter, Content.State| Constructor and Description |
|---|
StreamedAutoSignedStaticContent(File unsignedFile,
String userProvidedAlias,
ASJarSigner jarSigner,
String relativeURI,
String appName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAvailable(URI requestURI)
Reports whether the signed content is available.
|
void |
process(String relativeURIString,
org.glassfish.grizzly.http.server.Request gReq,
org.glassfish.grizzly.http.server.Response gResp)
Process the static content, adding the correct data to the response.
|
equals, file, hashCode, toStringresume, start, state, stop, suspendpublic StreamedAutoSignedStaticContent(File unsignedFile, String userProvidedAlias, ASJarSigner jarSigner, String relativeURI, String appName) throws FileNotFoundException
FileNotFoundExceptionpublic void process(String relativeURIString, org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp) throws IOException
StaticContentprocess in interface StaticContentprocess in class FixedContentrelativeURIString - URI path by which the content was addressedgReq - the requestgResp - the responseIOExceptionpublic boolean isAvailable(URI requestURI) throws IOException
AutoSignedContentisAvailable in interface ContentisAvailable in class AutoSignedContentIOExceptionCopyright © 2017. All rights reserved.