Skip to main content
Inspiring
February 14, 2018
Question

Pulling information from a digital certificate.

  • February 14, 2018
  • 1 reply
  • 436 views

Ok, I've tried figuring this out so now I'm asking the experts.

Is there a way to pull information from a digital certificate and input that information into a text field?

When I look into the certificate viewer in the Details tab, I see the data I want.  It's included with other information...here's how it looks:

Name = Subject

Value = cn=lastname.firstname.middlename.1234567890

I want to pull the '1234567890' and input it into a text field.  I'm trying to eliminate the user from filling in the information. We are CONSTANTLY having to look up the information because they typed it in wrong.

Is this possible?

Thanks,

Brian

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
February 15, 2018

Yes there is. The Acrobat JavaScript model has several properties/functions that provide security information.

For example, here's the entry in the JavaScript reference for the security object:

Acrobat DC SDK Documentation

But, digital certificates are usually in a signature field. If this is the case then this code returns the signature info object which is full of all kinds of stuff.

var sigInfo = getField( "Signature1" ).signatureInfo();

Look up the signature info object in the Acrobat JavaScript Reference.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often