From 2436aa273f00dafb465c2342ea8e7297898915d2 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 21 Jan 2014 09:57:16 +0100 Subject: Implementations for pdf-as-web and pdf-as-legacy --- .../at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index daf18108..e61a113a 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -66,14 +66,6 @@ public class PdfAsHelper { private static final String PDF_INVOKE_URL = "PDF_INVOKE_URL"; private static final String REQUEST_FROM_DU = "REQ_DATA_URL"; - // For development only: - public static final String keyStoreFile = "/home/afitzek/devel/pdfas_neu/test.p12"; - public static final String keyStoreType = "PKCS12"; - public static final String keyStorePass = "123456"; - // public static final String keyAlias = "pdf"; - public static final String keyAlias = "ecc_test"; - public static final String keyPass = "123456"; - private static final Logger logger = LoggerFactory .getLogger(PdfAsHelper.class); @@ -83,9 +75,14 @@ public class PdfAsHelper { static { // TODO: read from config file logger.debug("Creating PDF-AS"); - pdfAs = PdfAsFactory.createPdfAs(new File("/home/afitzek/.pdfas")); + pdfAs = PdfAsFactory.createPdfAs(new File(WebConfiguration.getPdfASDir())); logger.debug("Creating PDF-AS done"); } + + public static void init() { + logger.debug("PDF-AS Helper initialized"); + } + private static void validatePdfSize(HttpServletRequest request, HttpServletResponse response, byte[] pdfData) @@ -218,11 +215,10 @@ public class PdfAsHelper { if (connector.equals("moa")) { signer = new PAdESSigner(new MOAConnector(config)); } else { - // TODO: - // signer = new PAdESSignerKeystore(file, alias, kspassword, - // keypassword, type) - signer = new PKCS7DetachedSigner(keyStoreFile, keyAlias, - keyStorePass, keyPass, keyStoreType); + signer = new PKCS7DetachedSigner(WebConfiguration.getKeystoreFile(), + WebConfiguration.getKeystoreAlias(), + WebConfiguration.getKeystorePass(), WebConfiguration.getKeystoreKeyPass(), + WebConfiguration.getKeystoreType()); } signParameter.setPlainSigner(signer); -- cgit v1.2.3