sonatype/digest-applet — pull request #1 by schierlm (2012-11-14 21:26:09+00:00)
Title: Use JNLP FileOpenService to access local files

This removes the requirement of signing the Applet JAR. In addition, the user does not need to trust the applet, because the applet will specifically ask for each file it wants to access, unless the user chooses not to be asked again.

This requires loading the applet via jnlp_href parameter, which needs a JRE6u10 or later version of the Java plugin, but a (signed) old version as a fallback applet can be provided if desired.

Note that some versions of the Applet Plugin do not support LiveConnect calls on the HTML applet tag (when the applet is loaded via JNLP), therefore this applet calls a JavaScript function setDigestApplet and passes a reference to itself, which can be stored in a JavaScript variable and used later for calling the applet.

For a backwards compatible version of the applet (older plugins will use the existing signed digestapplet.jar), name the new version digestapplet-new.jar and use an applet tag like this (applet.jnlp is part of this pull request):

Use a Javascript function like this to collect the digest applet reference:

var digestAppletReference = null;
function setDigestApplet(ref) {
digestAppletReference = reff;
}

then use `digestAppletReference || document.digestapplet` to access the applet.