TX Text Control can be efficiently used to create Adobe PDF documents with digital signatures. These signatures can be created with PFX, DER Cer or Base64 CER certificate files.

Usually, you would use code signing certificates to sign PDF documents with a company-wide certificate. But it is also possible to use the much cheaper individual Digital IDs for secure e-mail.

The following tutorial shows how to do that with TX Text Control.

  1. Get your Digital ID for secure E-Mail

    There are several authentication companies such as Symantec where to get those certificates. This tutorial explains how to get a test certificate from Symantec (formerly VeriSign).

    Use the Internet Explorer (important!) and start the enrollment:

    https://digitalid.verisign.com/client/enroll.htm

    Click on Microsoft Internet Explorer and confirm the following Web Access Confirmation dialog with Yes.

    Get your Digital ID for Secure E-Mail
  2. Complete the enrollment form. You need to complete the name and e-mail address. You can start with a free 60-day trial digital ID.

    Get your Digital ID for Secure E-Mail

    Finalize your enrollment by clicking Accept at the bottom of the page.

  3. An e-mail has been sent to your given e-mail address. Click on the pickup link in the e-mail to confirm your e-mail address and follow the instructions in the e-mail.

    Type in the Digital ID Personal Identification Number (PIN) that has been sent in the e-mail and confirm with Submit.

  4. Click on Install and confirm the Web Access Confirmation dialog with Yes to install the certificate.

    Get your Digital ID for Secure E-Mail
  5. Open Certificate Manager by clicking the Windows Start button, typing certmgr.msc into the Search box, and then pressing ENTER.‌

    Open the Personal, Certificates node of the left-hand tree view and select the recently issued certificate.

    Right click the certificate entry and choose Export... from the All Tasks context menu.

    Get your Digital ID for Secure E-Mail
  6. In the opened Certificate Export Wizard, click Next on the welcome page.

    On the second page, choose Yes, export the private key and confirm with Next.

    Get your Digital ID for Secure E-Mail

    Now, select Personal Information Exchange - PKCS #12 (.PFX) as the export file format and continue with Next.

    Get your Digital ID for Secure E-Mail

    Type in and repeat a secure password to protect the PFX file and confirm with Next.

    Specify the name of the file you want to export and continue the process by clicking Next.

    Then click Finish to export the certificate.

  7. In Visual Studio, you can use the following code to export the Adobe PDF file with TX Text Control. test.pfx is the exported certificate from the above process.

    TXTextControl.SaveSettings settings = new TXTextControl.SaveSettings();
    X509Certificate2 cert = new X509Certificate2("test.pfx", "123");
    settings.DigitalSignature =
        new TXTextControl.DigitalSignature(cert, null);
    
    textControl1.Save("results.pdf",
        TXTextControl.StreamType.AdobePDF, settings);