From 1761001e82a4abcfc90d6ee93c4e867c66bedd34 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 12 Dec 2013 12:16:35 +0100 Subject: PKCS7 modifications --- .../sigs/pkcs7detached/PKCS7DetachedSigner.java | 30 +++------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'signature-standards/sigs-pkcs7detached/src/main') diff --git a/signature-standards/sigs-pkcs7detached/src/main/java/at/gv/egiz/pdfas/sigs/pkcs7detached/PKCS7DetachedSigner.java b/signature-standards/sigs-pkcs7detached/src/main/java/at/gv/egiz/pdfas/sigs/pkcs7detached/PKCS7DetachedSigner.java index 2110209a..6411fe67 100644 --- a/signature-standards/sigs-pkcs7detached/src/main/java/at/gv/egiz/pdfas/sigs/pkcs7detached/PKCS7DetachedSigner.java +++ b/signature-standards/sigs-pkcs7detached/src/main/java/at/gv/egiz/pdfas/sigs/pkcs7detached/PKCS7DetachedSigner.java @@ -31,6 +31,10 @@ 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; +/** + * Creates a PKCS7 detached PDF signature + * + */ public class PKCS7DetachedSigner implements IPlainSigner { private static final Logger logger = LoggerFactory @@ -55,29 +59,6 @@ public class PKCS7DetachedSigner implements IPlainSigner { return cert; } - class CMSProcessableInputStream implements CMSProcessable { - - InputStream in; - - public CMSProcessableInputStream(InputStream is) { - in = is; - } - - public Object getContent() { - return null; - } - - public void write(OutputStream out) throws IOException, CMSException { - // read the content only one time - byte[] buffer = new byte[8 * 1024]; - int read; - while ((read = in.read(buffer)) != -1) { - out.write(buffer, 0, read); - } - in.close(); - } - } - public byte[] sign(byte[] input, int[] byteRange) throws PdfAsException { try { IssuerAndSerialNumber issuer = new IssuerAndSerialNumber(cert); @@ -93,9 +74,6 @@ public class PKCS7DetachedSigner implements IPlainSigner { Attribute contentType = new Attribute(ObjectID.contentType, new ASN1Object[] { new ObjectID("1.2.840.113549.1.7.1") }); - // Attribute signingCert = new - // Attribute(ObjectID.signingCertificateV2, - // new ASN1Object[] { cert.toASN1Object() }); Attribute[] attributes = new Attribute[] { signingTime, contentType }; signer1.setSignedAttributes(attributes); -- cgit v1.2.3