Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Extract information from a digital signature to use in forms

Community Beginner ,
Jan 19, 2021 Jan 19, 2021

I am updating a traditionally printed form to be able to be signed electronically.  The form should be fully functioning as a printed empty form that can be completed by hand.  

 

I am using Acrobat Pro DC with company-issued digital certificate based signatures.

Consider:  I have a training record that has a person's name, department and line for them to sign.  This works well for printed records that need to be scanned and stored - nobody likes this but it is necessary to document training at the workplace with people that do not need a computer on the job.  

I also have many people that are working from home, these people need training as well on different topics and we are required to maintain the records.

I want to do is:

When a user signs with a certificate, I want a field to be populated on the form that includes their name (common or distinguished) and their department as present in their certificate.  

Please don't tell me that it is all visible in their signature, I know that already.  Some people have their certificate appearance very plain, easy to read, and some people have it filled with everything, making the text very small.  

  • It seems that I need to use Javascript to place data into the form fields when signed.  Can someone provide an easy sample?

Next, if possible, I would like to empty the form field upon "unsigning" the document.  

This is really two requests in one.  Please help!

TOPICS
How to , Security digital signatures and esignatures
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 19, 2021 Jan 19, 2021

Users need to be trained NEVER to look at document signatures. It is a terrible pity that they even exist. Users MUST be trained to check the signature's actual properties. The on screen stuff could be faked in seconds. But the info you want is already shown in the signature info panel and always comes from the signature. (Whether it proves identity depends on how certificates are assigned; self sign certificates don't prove identity; I could make one in seconds with your name, if I knew it!)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 27, 2021 Jan 27, 2021

Thanks, I have already configured a certificate authority server and issue each certificate to individuals.  I do allow them to change their appearance to what is appropriate. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 20, 2021 Jan 20, 2021

Yes, it's possible to do it. Here's how:

As the custom calculation script of the text field enter the following code:

var f = this.getField("Signature1");
if (f.valueAsString=="") event.value = "";
else event.value = f.signatureInfo().name;

 

And as the Signed script of the signature field enter:

this.calculateNow();

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 27, 2021 Jan 27, 2021

Thank you so much for your sample.  I typed it in exactly and I got the following message in the debugger console.

 

Capture.PNG

Exception in line 3 of function top_level, script AcroForm:Name1:Calculate

InvalidSetError: Set not possible, invalid or unknown.
Event.value:3:AcroForm:Name1:Calculate

-- It did put my e-mail address into the field though.  Is it possible to get just the name of the user - portion of the distinguished name?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 27, 2021 Jan 27, 2021
LATEST

To be specific - the field did put my Name followed by my e-mail address.  would it be possible to query the certificate to get the common name "cn" and also the "ou" ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines