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);