aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-11-27 17:52:48 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-11-27 17:52:48 +0100
commitb7a47b0feebd402d9a14d3f6d43ac6576c753367 (patch)
treea3e5204a0eb577fac131e57aa4a4f240afb3aae4
parent48216bdf6d0e6b8e34d53fe196c4a6a7ec868b93 (diff)
downloadpdf-as-4-b7a47b0feebd402d9a14d3f6d43ac6576c753367.tar.gz
pdf-as-4-b7a47b0feebd402d9a14d3f6d43ac6576c753367.tar.bz2
pdf-as-4-b7a47b0feebd402d9a14d3f6d43ac6576c753367.zip
Works in progress
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java2
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PdfboxSignerWrapper.java4
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/VerifierDispatcher.java4
-rw-r--r--signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java4
4 files changed, 8 insertions, 6 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
index 2e5dc62b..7273b8a9 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
@@ -73,7 +73,7 @@ public class PADESPDFBOXSigner implements IPdfSigner {
logger.debug("Signing @ " + signer.getSigningDate().getTime().toString());
// the signing date, needed for valid signature
- signature.setSignDate(signer.getSigningDate());
+ //signature.setSignDate(signer.getSigningDate());
signer.setPDSignature(signature);
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PdfboxSignerWrapper.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PdfboxSignerWrapper.java
index 6ded2d8a..0420cd11 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PdfboxSignerWrapper.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PdfboxSignerWrapper.java
@@ -10,6 +10,8 @@ import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+
import at.gv.egiz.pdfas.common.exceptions.PdfAsException;
import at.gv.egiz.pdfas.common.exceptions.PdfAsWrappedIOException;
import at.gv.egiz.pdfas.common.utils.PDFUtils;
@@ -40,7 +42,7 @@ public class PdfboxSignerWrapper implements PDFASSignatureInterface {
try {
byte[] signature = signer.sign(data, byteRange);
logger.debug("Signature Data: "
- + StringUtils.bytesToHexString(signature));
+ + iaik.utils.Util.toBase64String(signature));
FileOutputStream fos = new FileOutputStream("/tmp/fos.bin");
fos.write(signature);
fos.close();
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/VerifierDispatcher.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/VerifierDispatcher.java
index ee9c27ae..a7d4e80f 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/VerifierDispatcher.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/verify/VerifierDispatcher.java
@@ -18,8 +18,8 @@ public class VerifierDispatcher {
.getLogger(VerifierDispatcher.class);
public static final String[] currentClasses = new String[] {
- //"at.gv.egiz.pdfas.sigs.pkcs7detached.PKCS7DetachedVerifier",
- "at.gv.egiz.pdfas.sigs.pades.PAdESVerifier" };
+ "at.gv.egiz.pdfas.sigs.pkcs7detached.PKCS7DetachedVerifier"/*,
+ "at.gv.egiz.pdfas.sigs.pades.PAdESVerifier"*/ };
public Map<String, HashMap<String, IVerifyFilter>> filterMap = new HashMap<String, HashMap<String, IVerifyFilter>>();
diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java
index 6af44b59..b1662d02 100644
--- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java
+++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java
@@ -40,7 +40,7 @@ public class PAdESVerifier implements IVerifyFilter {
private String moaEndpoint;
private String moaTrustProfile;
- public PAdESVerifier(Configuration config) {
+ public PAdESVerifier() {
IAIK.getInstance();
ECCProvider.addAsProvider();
}
@@ -140,7 +140,7 @@ public class PAdESVerifier implements IVerifyFilter {
public List<FilterEntry> getFiters() {
List<FilterEntry> result = new ArrayList<FilterEntry>();
- result.add(new FilterEntry(PDSignature.FILTER_ADOBE_PPKLITE, PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED));
+ result.add(new FilterEntry(PDSignature.FILTER_ADOBE_PPKLITE, PDSignature.SUBFILTER_ETSI_CADES_DETACHED));
return result;
}