| |
@@ -0,0 +1,50 @@
|
| |
+ From bec4a46950fb5a81f81baf649edfb0af428c9dd0 Mon Sep 17 00:00:00 2001
|
| |
+ From: Tilman Hausherr <tilman@apache.org>
|
| |
+ Date: Thu, 17 Sep 2020 18:05:14 +0000
|
| |
+ Subject: [PATCH] PDFBOX-4892: replace deprecated DEROutputStream
|
| |
+
|
| |
+ git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1881799 13f79535-47bb-0310-9956-ffa450edef68
|
| |
+ ---
|
| |
+ .../encryption/PublicKeySecurityHandler.java | 14 +++++---------
|
| |
+ 1 file changed, 5 insertions(+), 9 deletions(-)
|
| |
+
|
| |
+ diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
|
| |
+ index 3d65793c34..702622ece9 100644
|
| |
+ --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
|
| |
+ +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
|
| |
+ @@ -44,12 +44,12 @@
|
| |
+ import org.apache.pdfbox.cos.COSName;
|
| |
+ import org.apache.pdfbox.cos.COSString;
|
| |
+ import org.apache.pdfbox.pdmodel.PDDocument;
|
| |
+ +import org.bouncycastle.asn1.ASN1Encoding;
|
| |
+ import org.bouncycastle.asn1.ASN1InputStream;
|
| |
+ import org.bouncycastle.asn1.ASN1ObjectIdentifier;
|
| |
+ import org.bouncycastle.asn1.ASN1Primitive;
|
| |
+ import org.bouncycastle.asn1.ASN1Set;
|
| |
+ import org.bouncycastle.asn1.DEROctetString;
|
| |
+ -import org.bouncycastle.asn1.DEROutputStream;
|
| |
+ import org.bouncycastle.asn1.DERSet;
|
| |
+ import org.bouncycastle.asn1.cms.ContentInfo;
|
| |
+ import org.bouncycastle.asn1.cms.EncryptedContentInfo;
|
| |
+ @@ -477,17 +477,13 @@ private void prepareEncryptionDictAES(PDEncryption encryptionDictionary, COSName
|
| |
+ pkcs7input[21] = three;
|
| |
+ pkcs7input[22] = two;
|
| |
+ pkcs7input[23] = one;
|
| |
+ -
|
| |
+ +
|
| |
+ ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
|
| |
+ -
|
| |
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
| |
+ -
|
| |
+ - DEROutputStream k = new DEROutputStream(baos);
|
| |
+ -
|
| |
+ - k.writeObject(obj);
|
| |
+ -
|
| |
+ + obj.encodeTo(baos, ASN1Encoding.DER);
|
| |
+ +
|
| |
+ recipientsField[i] = baos.toByteArray();
|
| |
+ -
|
| |
+ +
|
| |
+ i++;
|
| |
+ }
|
| |
+ return recipientsField;
|
| |