aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-12-12 12:16:35 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-12-12 12:16:35 +0100
commit1761001e82a4abcfc90d6ee93c4e867c66bedd34 (patch)
treeda1af42eccb7e1ed4912f39d708f51bba8a4e8de
parent2b38db4f888c15f283a22acbdc75ac90d01f3141 (diff)
downloadpdf-as-4-1761001e82a4abcfc90d6ee93c4e867c66bedd34.tar.gz
pdf-as-4-1761001e82a4abcfc90d6ee93c4e867c66bedd34.tar.bz2
pdf-as-4-1761001e82a4abcfc90d6ee93c4e867c66bedd34.zip
PKCS7 modifications
-rw-r--r--signature-standards/sigs-pkcs7detached/src/main/java/at/gv/egiz/pdfas/sigs/pkcs7detached/PKCS7DetachedSigner.java30
1 files changed, 4 insertions, 26 deletions
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);