File pdfbox-1.8.12-bouncycastle.patch of Package apache-pdfbox.8984

--- pdfbox-1.8.12/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java	2017-09-15 07:55:42.552501155 +0200
+++ pdfbox-1.8.12/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java	2017-09-15 08:21:29.621212330 +0200
@@ -38,7 +38,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import org.bouncycastle.asn1.ASN1InputStream;
-import org.bouncycastle.asn1.DERObject;
+import org.bouncycastle.asn1.ASN1Primitive;
 import org.bouncycastle.asn1.DERObjectIdentifier;
 import org.bouncycastle.asn1.DEROctetString;
 import org.bouncycastle.asn1.DEROutputStream;
@@ -53,9 +53,6 @@
 import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
 import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
 import org.bouncycastle.asn1.x509.TBSCertificateStructure;
-import org.bouncycastle.cms.CMSEnvelopedData;
-import org.bouncycastle.cms.CMSException;
-import org.bouncycastle.cms.RecipientInformation;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSString;
 import org.apache.pdfbox.exceptions.CryptographyException;
@@ -311,7 +308,7 @@
                 pkcs7input[22] = two;
                 pkcs7input[23] = one;
 
-                DERObject obj = createDERForRecipient(pkcs7input, certificate);
+                ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
 
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
@@ -378,7 +375,7 @@
 
     }
 
-    private DERObject createDERForRecipient(byte[] in, X509Certificate cert)
+    private ASN1Primitive createDERForRecipient(byte[] in, X509Certificate cert)
         throws IOException,
                GeneralSecurityException
     {
@@ -389,7 +386,7 @@
         AlgorithmParameters algorithmparameters = algorithmparametergenerator.generateParameters();
         ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(algorithmparameters.getEncoded("ASN.1"));
         ASN1InputStream asn1inputstream = new ASN1InputStream(bytearrayinputstream);
-        DERObject derobject = asn1inputstream.readObject();
+        ASN1Primitive derobject = asn1inputstream.readObject();
         KeyGenerator keygenerator = KeyGenerator.getInstance(s);
         keygenerator.init(128);
         SecretKey secretkey = keygenerator.generateKey();