Digital Signing and Certifying

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  Digital Signing and Certifying

DynamicPDF CoreSuite for .NET (v5) Forum

 Oct 19 2009 1:18 AM
Hi All,
I am making an evaluation.
I need to make a document and then certify and sign it.
I am using the code below to do it:

1: Document document = new Document();
2: Page page = new Page();

3: //Create & add Signature Form Field
4: Signature signature1 = new Signature("SigField1", 10, 10, 250, 100);
5: Signature certify = new Signature("CertifyField", 50, 50, 250, 100);
6: page.Elements.Add(signature1);
7: page.Elements.Add(certify);
8: document.Pages.Add(page);

9: Certificate certificate1 = new Certificate("Store", StoreLocation.LocalMachine, "certificate1");
10: Certificate certificate2 = new Certificate("Store", StoreLocation.LocalMachine, "certificate2");

11: // Field name should be one of the signature field name
12: document.Certify("CertifyField", certificate1, CertifyingPermission.AllowFormFillingAndAnnotation);
13: document.Sign("SigField1", certificate2);
14: document.Draw(@"sign.pdf");

But I have an error "Certificate already added for signing" in line 13.

If I sign a signed document I take this error too.
 Oct 19 2009 8:49 AM
Posted by a ceTe Software moderator
Hello,

Currently it is not possible to sign and certify the PDF documents simultaneously. You can either sign or certify, but not do both. The developers are currently working on allowing both, the ability to sign and certify PDF documents. We are not sure of any timeline on when this will be implemented.

Thanks,
ceTe Software Support Team

 Oct 20 2009 1:20 AM
Can I set a two signatures?
 Oct 20 2009 6:16 AM
Posted by a ceTe Software moderator
Hello,

Currently it is not possible to add two signatures to one PDF document. We may add this feature support in a future version but we currently do not have any immediate plans or time frame on adding this feature.

Thanks,
ceTe Software Support Team.
 Apr 07 2022 11:57 AM
Hi,

You recently added the possibility to have two digital signatures in a document, by using the class IncrementalUpdateDocument. I would like to do a digital signature and then certify the document. But that class only have property telling if the document is certified or not. So I guess that this is not possible at the moment?
If it is, can you show me an example on how to do that?

Best regards Stefan
 Apr 07 2022 12:05 PM
Hi,

I realize that my previous post ended up in wrong thread. It should be in CoreSuit for .NET (v11). I hope this is not a problem.
I use version 11.27.0

Best regards Stefan
 Apr 07 2022 1:29 PM
Posted by a ceTe Software moderator
Hi,

Yes,  the IncrementalUpdateDocument class is included in v11 DynamicPDF Core Suite for .NET product and is not available in v10 or ealier.

You can only sign multiple signatures using the IncrementalUpdateDocument class and it will not allow you to certify the document.

If you want to certify the document, then you will need to use MergeDocument object but only one signature can be signed using this MergeDocument object.

Incremental signing is dependent on the permission type set to the document, that is whether the document changes are allowed or not.

Here is a code sample to certify a document using a MergeDocument object and sign another signature field using an IncremantalUpdateDocument object.

            string inputPdfPath = @"C:\Temp\SigntureFieldPdf.pdf";
            PdfDocument inputPdfDocument = new PdfDocument(inputPdfPath);
            //Certify the the Document using MergeDocument class.
            MergeDocument document = new MergeDocument(inputPdfDocument);
            Certificate certificate = new Certificate(@"Certificate file path", "password");
            // Signature field name : Signature field should be an existing one.
            document.Certify("Sign1", certificate, CertifyingPermission.AllowFormFilling);
           //Draw it to byte array
            byte[] PdfByteData = document.Draw();

            //Load the PDF for another signing.
            PdfDocument pdf = new PdfDocument(PdfByteData);
            ceTe.DynamicPDF.Merger.IncrementalUpdateDocument document1 = new IncrementalUpdateDocument(pdf);
            bool isCertified= document1.Certified;
            Certificate certificate1 = new Certificate(@"certificte file path", "password");
            // Signature field name : Signature field should be an existing one.
            document1.Sign("Sign2", certificate1);
            string outputPdfPath = @"C:\Temp\IncrementalSign.pdf";
            document1.Draw(outputPdfPath);

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 1:20 AM.