From 94c33f3d604ebf9a37dba551eb822b57ebfea902 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 4 Jun 2014 16:12:10 +0200 Subject: Added TransactionId for Signatures --- .../src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java | 9 +++++---- .../java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'signature-standards/sigs-pades/src/main') diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java index 7c6269e0..67b17783 100644 --- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java @@ -29,6 +29,7 @@ import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature; import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.lib.api.sign.IPlainSigner; +import at.gv.egiz.pdfas.lib.api.sign.SignParameter; import at.gv.egiz.sl.util.ISignatureConnector; import at.gv.egiz.sl.util.ISignatureConnectorSLWrapper; import at.gv.egiz.sl.util.ISLConnector; @@ -45,12 +46,12 @@ public class PAdESSigner implements IPlainSigner { this.plainSigner = signer; } - public X509Certificate getCertificate() throws PdfAsException { - return this.plainSigner.getCertificate(); + public X509Certificate getCertificate(SignParameter parameter) throws PdfAsException { + return this.plainSigner.getCertificate(parameter); } - public byte[] sign(byte[] input, int[] byteRange) throws PdfAsException { - return this.plainSigner.sign(input, byteRange); + public byte[] sign(byte[] input, int[] byteRange, SignParameter parameter) throws PdfAsException { + return this.plainSigner.sign(input, byteRange, parameter); } public String getPDFSubFilter() { diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java index f0eedb61..7f62b294 100644 --- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java @@ -58,6 +58,7 @@ import org.slf4j.LoggerFactory; import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.common.exceptions.PdfAsSignatureException; import at.gv.egiz.pdfas.lib.api.sign.IPlainSigner; +import at.gv.egiz.pdfas.lib.api.sign.SignParameter; import at.gv.egiz.pdfas.lib.util.CertificateUtils; public class PAdESSignerKeystore implements IPlainSigner { @@ -81,7 +82,7 @@ public class PAdESSignerKeystore implements IPlainSigner { } } - public X509Certificate getCertificate() { + public X509Certificate getCertificate(SignParameter parameter) { return cert; } @@ -133,7 +134,7 @@ public class PAdESSignerKeystore implements IPlainSigner { signerInfo.setSignedAttributes(attributeArray); } - public byte[] sign(byte[] input, int[] byteRange) throws PdfAsException { + public byte[] sign(byte[] input, int[] byteRange, SignParameter parameter) throws PdfAsException { try { logger.info("Creating PAdES signature."); IssuerAndSerialNumber issuer = new IssuerAndSerialNumber(cert); -- cgit v1.2.3