View invisible signature

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v6)  /  Re: View invisible signature

DynamicPDF CoreSuite for .NET (v6) Forum

 May 21 2013 6:40 PM
If I add an invisible signature to a document using the Document.sign method. Is there a way to see that the document has been signed and if so by whom? Or do I need to add a visible signature to see that?
 May 22 2013 9:10 AM
Posted by a ceTe Software moderator
Hello,

You can add visible or invisible digital signature to the PDF document without any problem. Please refer documentation on digital signing here.

The visible signature is visible on the PDF page and in the signature panel  within the navigation panel. The invisible signature is not visible on the PDF page but you can view the signature details in the signature panel within the navigation panel.

Thanks,
ceTe Software Support Team.
 May 28 2016 12:29 AM
i used itext sharp to get digital signature.

but after signed
it is in invisible mode.
please help me to make signature as visible mode


this the following code:
------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
using System.IO;

using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

using iTextSharp.text.pdf;
using iTextSharp.text.pdf.security;

namespace Saturday
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private SecureString GetSecurePin(string PinCode)
        {
            SecureString pwd = new SecureString();
            foreach (var c in PinCode.ToCharArray()) pwd.AppendChar(c);
            return pwd;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            X509Store store = new X509Store(StoreLocation.CurrentUser);
            store.Open(OpenFlags.ReadOnly);
            X509Certificate2 cert = null;
            //manually chose the certificate in the store
            X509Certificate2Collection sel = X509Certificate2UI.SelectFromCollection(store.Certificates, null, null, X509SelectionFlag.SingleSelection);
            if (sel.Count > 0)
                cert = sel[0];
            else
            {
                MessageBox.Show("Certificate not found");
                return;
            }
            SignWithThisCert(cert);
        }


        private void SignWithThisCert(X509Certificate2 cert)
        {

                 OpenFileDialog b = new OpenFileDialog();
                 openFileDialog1.ShowDialog();
                 textBox1.Text=  openFileDialog1.FileName;
            string SourcePdfFileName = textBox1.Text;
            string DestPdfFileName = textBox1.Text + "-Signed.pdf";
            Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser();
            Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(cert.RawData) };
            IExternalSignature externalSignature = new X509Certificate2Signature(cert, "SHA-1");
            PdfReader pdfReader = new PdfReader(SourcePdfFileName);
            FileStream signedPdf = new FileStream(DestPdfFileName, FileMode.Create);  //the output pdf file
            PdfStamper pdfStamper = PdfStamper.CreateSignature(pdfReader, signedPdf, '\0');
            PdfSignatureAppearance signatureAppearance = pdfStamper.SignatureAppearance;
        
          
            //here set signatureAppearance at your will
            signatureAppearance.Reason = "Because I can";
            signatureAppearance.Location = "My location";

          
            signatureAppearance.SignatureRenderingMode = PdfSignatureAppearance.RenderingMode.DESCRIPTION;
            MakeSignature.SignDetached(signatureAppearance, externalSignature, chain, null, null, null, 0, CryptoStandard.CMS);
            //MakeSignature.SignDetached(signatureAppearance, externalSignature, chain, null, null, null, 0, CryptoStandard.CADES);
            MessageBox.Show("Done");


          

        }


    }
    }

 May 31 2016 9:55 AM
Posted by a ceTe Software moderator
Hello,

It is not possible to make the invisible signature present in the PDF visible using any of our DynamicPDF APIs. You can remove the invisible signature from the existing PDF and add new visible signature using latest DynamicPDF Merger API. Below is the code sample for it. If you would like to evaluate latest version 8 product then you can download the evaluation edition from our website here.

            //Code for removing the invisible signature.
            PdfDocument pdf = new PdfDocument("Path for input PDF");
            MergeDocument document = new MergeDocument(pdf);
            int c=document.Form.Fields.Count;
            document.Form.Fields[0].Output = FormFieldOutput.Remove;
            //Code to add visible signature.
            Signature signature2 = new Signature("MySigFieldNew", 10, 10, 300, 100);
            document.Pages[0].Elements.Add(signature2);
            Certificate certificate2 = new Certificate(@"Path for the certificate file", "password");
            document.Sign("MySigFieldNew", certificate2);
            document.Draw("C:/Temp/certTest.pdf");

Thanks,
ceTe Software Support Team.
 Aug 30 2018 4:27 AM
Hi I have web app that  displays  a pdf docment created using dynamic pdf  generator. It  has  forms for user to fill there information. It also has a field  for user to provide digital signature.  We have added an button in the generated pdf with action to send the form data to an server. 
The users downloads the pdf and fills the details in the form fields and also provides the digital signature using PDF Reader. The digital signature is displayed on the pdf
Wen the user clicks on the button in pdf  the server receives the  fields filled by user and the server generates and dispays on the we an  new pdf with the data filled in the form fields.

Problem is the servers is able to receive data for all the field but not for the digital signed fields. Could nor receive values for the digital signature fields on form submit  I am using the below action for submitting the form.

 SubmitAction action = new SubmitAction(serveruURL);
                action.ExportFormat = FormExportFormat.XML;

Is thare a way that i can send an information from the  digital signature fields to the server and re genrates a pdf with the same digital signature info.
 Aug 30 2018 2:28 PM
Posted by a ceTe Software moderator
Hello,

Digitally signed fields work differently compare to other form fields. Once you digitally sign a field, it is not possible to read or export the data contained within that signed field. A signed field contains content that is encrypted and is unique to the PDF it is added to. Hence it is not possible to export or extract that digital signature information and use that to sign the regenerated PDF on the server side.

In order to digitally sign PDFs using DynamicPDF on server side, you would need the .pfx signature file of your user. The only way to do this on the server is to have your user send their .pfx file along with the form data to your server (potentially via a web form) where you can fill the form fields and sign the PDF programmatically.  If that is not feasible, then the user would need to send the actual PDF that they signed via an email or upload it to your server using a web form or by some other means.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 2:14 AM.