Hi!
Hi Johannes,
Hi!
Hi Johannes,
Hi Team!
Hi Johannes,
Hi, i have sent you an E-Mail with the sensitive data because i was unable to select "Keep this post private"
Hi Johannes,
Hello!
Hi,
Hi, I am facing the same problem and I do not know waht to do because convert PDF to PDFA is mandatory before signing it and always I try two sign it for the second time the first signature got invalid.
Hi Andre,
Thanks for contacting support.
As per my understanding, you are first converting PDF file to PDF/A_1b format and then digitally signing the PDF/A file. In order to test the scenario, I have used one of my sample digital signatures and when I have tried digitally signing PDF/A document, the PDF/A compliance is lost. Because as per PDF/A standards, the documents cannot be modified and if we make any changes, the compliance is lost.
Furthermore, when signing the document twice, it corrupts/invalidates the signature inside the document and it has already been logged in our issue tracking system as PDFNET-40288. However request you to please share some more details on why you need to sign the document twice and your digital signature so that we can further look into this matter. For your reference, I have also attached the output generated over my end.
We are sorry for this inconvenience.
[C#]
// Path to digital signature
string pbxFile = "c:/pdftest/MySPC.pfx";
string inFile = @"c:/pdftest/99180_d8390159-b0f0-45c8-bdff-683472a31cc1.pdf";
// Load input PDF file
Document doc = new Document(inFile);
// Convert document to PDF/A compliance format
doc.Convert(new MemoryStream(), PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
// Save PDF/A output
doc.Save("c:/pdftest/ConvertedPDF_A_1b.pdf");
string outFile = @"c:/pdftest/99180_d8390159-b0f0-45c8-bdff-683472a31cc1_DigitallySign_out.pdf";
using (Document document = new Document("c:/pdftest/ConvertedPDF_A_1b.pdf"))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{
Aspose.Pdf.Forms.PKCS7 pkcs = new Aspose.Pdf.Forms.PKCS7(pbxFile, "test");
Aspose.Pdf.Forms.DocMDPSignature docMdpSignature = new Aspose.Pdf.Forms.DocMDPSignature(pkcs, Aspose.Pdf.Forms.DocMDPAccessPermissions.FillingInForms);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
// Set signature appearance
signature.SignatureAppearance = @"c:/pdftest/Conversion.PNG";
// Create a certified signature
signature.Certify(1, "Signature Reason", "Contact", "Location", true, rect, docMdpSignature);
// Save output PDF file
signature.Save(outFile);
}
}
using (Document document = new Document(outFile))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{
System.Collections.IList sigNames = signature.GetSignNames();
if (sigNames.Count > 0) // Any signatures?
{
if (signature.VerifySigned(sigNames[0] as string)) // Verify first one
{
if (signature.IsCertified) // Certified?
{
if (signature.GetAccessPermissions() == Aspose.Pdf.Forms.DocMDPAccessPermissions.FillingInForms) // Get access permission
{
// Do something
}
}
}
}
}
}
Thanks for your patience.
Our product team has further investigated the earlier logged issue PDFNET-40895, which was related to certifying PDF Document(s). Please note note that this is not the issue/bug related to the Aspose.Pdf API, but you need to add certificate into trusted store. Here you can find more details about setting [signature trust in Adobe Reader](http://blogs.adobe.com/security/2008/08/setting_signature_trust_in_ado_2.html)
.
Please take a look on attached screenshot and file certified2_DOESNTWORK.out.pdf, produced after adding certificate to trust store. As far as other logged issue PDFNET-40288 is concerned, we will let you know, once it is resolved. Please spare us little time.
cert.png (34.6 KB)
certified2_DOESNTWORK.out.pdf (115.7 KB)
We are sorry for the inconvenience.
Hi!
The issue is not resolved yet! - your mixing up things! - Read the thread carefully from the beginning!
And dont get confused by the post of “Jonatas” - he is talking from something different in the end!!
I know i’m unable to a sign a document again or change its content after signing - i am aware of it!!
Thanks for contacting support.
We have again tested the scenario with Aspose.PDF for .NET 18.2 and noticed following:
Before Adding the Certificate to Trust Store:
Both output PDF documents showed invalid certificate prompt in Adobe Reader 9 Pro and Adobe Acrobat Reader DC 2018.011.20038.
After Adding the Certificate to Trust Store:
We added the certificate to trust store in both versions of Adobe Reader and certificate was validated in Adobe Reader 9 Pro - whereas the Adobe Acrobat Reader DC kept showing invalid certificate message. Certificate_Validity.png (71.4 KB)
Furthermore, we have also noticed your comments that you are facing invalid certificate error, only in case when document is in PDF/A format. Standard PDF-15 format document, does not cause any issue at your side. Would you please share the Adobe Reader Version which you are using at your end along with some screenshots showing the certificate validity problem.
We have re-opened the relevant issue, so we will provide these details to the respective team. This would definitely help in investigating the issue.
We are sorry for the inconvenience.
The issues you have found earlier (filed as PDFNET-40288) have been fixed in Aspose.PDF for .NET 21.7.