Skip to content

Commit 6919b5c

Browse files
realityoneUbuntu
authored andcommitted
Set output stream as DER
DEVSIX-6119
1 parent 57b8664 commit 6919b5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/src/main/java/com/itextpdf/kernel/crypto/securityhandler/PubKeySecurityHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ This file is part of the iText (R) project.
5151
import com.itextpdf.kernel.pdf.PdfLiteral;
5252
import com.itextpdf.kernel.pdf.PdfName;
5353
import com.itextpdf.kernel.security.IExternalDecryptionProcess;
54+
import org.bouncycastle.asn1.ASN1Encoding;
5455
import org.bouncycastle.asn1.ASN1InputStream;
5556
import org.bouncycastle.asn1.ASN1OutputStream;
5657
import org.bouncycastle.asn1.ASN1Primitive;
@@ -250,7 +251,7 @@ private byte[] getEncodedRecipient(int index) throws IOException, GeneralSecurit
250251
pkcs7input[23] = one;
251252

252253
ByteArrayOutputStream baos = new ByteArrayOutputStream();
253-
ASN1OutputStream k = ASN1OutputStream.create(baos);
254+
ASN1OutputStream k = ASN1OutputStream.create(baos, ASN1Encoding.DER);
254255
ASN1Primitive obj = createDERForRecipient(pkcs7input, (X509Certificate) certificate);
255256
k.writeObject(obj);
256257
cms = baos.toByteArray();

0 commit comments

Comments
 (0)