Ve windows se spustí podepisovací aplikace, která si bere certifikáty ze systémového uložiště.

refs #224
Verze_3.0
Josef Rokos 10 years ago
parent d7999e78ca
commit 11e3a48b28

@ -63,6 +63,7 @@ public class JnlpGeneratorImpl implements JnlpGenerator {
root.appendChild(security); root.appendChild(security);
Element resources = document.createElement("resources"); Element resources = document.createElement("resources");
resources.setAttribute("os", "Linux");
Element j2se = document.createElement("j2se"); Element j2se = document.createElement("j2se");
j2se.setAttribute("version", "1.8+"); j2se.setAttribute("version", "1.8+");
Element jar = document.createElement("jar"); Element jar = document.createElement("jar");
@ -71,6 +72,17 @@ public class JnlpGeneratorImpl implements JnlpGenerator {
resources.appendChild(jar); resources.appendChild(jar);
root.appendChild(resources); root.appendChild(resources);
Element resourcesWin = document.createElement("resources");
resourcesWin.setAttribute("os", "Windows");
Element j2seWin = document.createElement("j2se");
j2seWin.setAttribute("version", "1.8+");
Element jarWin = document.createElement("jar");
jarWin.setAttribute("href", "pdfsignerWin.jar");
resourcesWin.appendChild(j2seWin);
resourcesWin.appendChild(jarWin);
root.appendChild(resourcesWin);
Element appDesc = document.createElement("application-desc"); Element appDesc = document.createElement("application-desc");
appDesc.setAttribute("main-class", "info.bukova.pdfsigner.Main"); appDesc.setAttribute("main-class", "info.bukova.pdfsigner.Main");
Element argUrl = document.createElement("argument"); Element argUrl = document.createElement("argument");

@ -102,7 +102,22 @@ public class SigningController {
@RequestMapping(value="/sign/pdfsigner.jar", method= RequestMethod.GET) @RequestMapping(value="/sign/pdfsigner.jar", method= RequestMethod.GET)
public void pdfsigner(HttpServletResponse response) { public void pdfsigner(HttpServletResponse response) {
File inputJar = new File(context.getRealPath("/WEB-INF/signer/PDFSigner.jar")); sendJar(response, "Linux");
}
@RequestMapping(value="/sign/pdfsignerWin.jar", method= RequestMethod.GET)
public void pdfsignerWin(HttpServletResponse response) {
sendJar(response, "Windows");
}
private void sendJar(HttpServletResponse response, String os) {
File inputJar;
if (os.startsWith("Windows")) {
inputJar = new File(context.getRealPath("/WEB-INF/signer/PDFSignerWin.jar"));
} else {
inputJar = new File(context.getRealPath("/WEB-INF/signer/PDFSigner.jar"));
}
try { try {
byte[] data = new byte[(int) inputJar.length()]; byte[] data = new byte[(int) inputJar.length()];

Loading…
Cancel
Save