Free Support Forum - aspose.com

Removing invalid signatures

Hi,


We created PDF documents with invalid signature objects and are now trying to remove the invalid signature. Every time I load the PDF into the PdfFileSignature class, the IsCertified field is throwing an exception because the signature object is invalid.

Is there a way to remove the invalid signature?

I’m on version 9.9.0

Thanks,

Dai

Hi Dai,


Thanks for your inquiry. We will appreciate it if you please share your sample code and input/output document here, so we will test the scenario and will guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,
This is the code I'm testing with to try to remove the invalid signature. The file is attached to the original post.

using (var pdfSign = new PdfFileSignature())
{
pdfSign.BindPdf("digitally-signed-invalid-signature.pdf");
var signatureNames = pdfSign.GetSignNames();
foreach (var t in signatureNames)
{
pdfSign.RemoveSignature((string)t);
}
pdfSign.Save("digitally-signed-invalid-signature-removed.pdf");
}

Thanks,

Dai

Hi Dai,


Thanks for sharing the resource file.

I have tested the scenario and I am able to
notice the same problem. For the sake of correction, I have logged this problem
as
PDFNEWNET-39325 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.