PdfFileSignature throws NullReferenceException on the Save method when using streams instead of files for input and output

Using the latest version of Aspose.Pdf.Kit (5.4.0) and using a stream instead of a file for both the input and output of a PdfFileSignature instance makes the Save method throw a NullReferenceException with as message: “Path cannot be null.”.

Example Code:

   var signature = new Aspose.Pdf.Kit.Pkcs7Signature(false, pfxStream, pwd);

var signedPDF = new Aspose.Pdf.Kit.PdfFileSignature();
signedPDF.BindPdf(unsignedPdfFileInputStream);
signedPDF.Sign(1, false, Rectangle.Empty, signature);
signedPDF.Save(signedPdfFileOuputStream);

Hi Peter,

Please share the input PDF and PFX files with us, so we could reproduce the issue at our end. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,