Expand my Community achievements bar.

Compare two signature fields

Avatar

Level 1

Hi

I'm developing a form with Adobe Livecycle Designer 9.0 for end users with Adobe Reader 9 or higher
The form has two signature fields.
At the moment of inserting the second signature I want to validate that the certificate used is not the same certificate used to apply the signature in the first field
In case both signature fields are signed with the same certificate, I need to reject/don't allow the second signature
Any idea or recommendation about how to implement that?
Thanks
Ariel
6 Replies

Avatar

Employee

Do you want to disallow the signing itself when user tries to use same credential to sign the second signature field or would you want to reject the PDF form in your workflow when performing validation on both signature fields?

If it is the latter you can use LiveCycle Signatures validation APIs to ascertain if same credential has been used to apply digital signature on both the fields.

If it is former you can add a script in presign event of second signature field which validates the credential info from signature field 1 and if both are same then pop-up a message and cancel sign operation

Avatar

Level 1

Hi Santosh

I want to disallow the signing, when user tries to use same credential to sign the second signature field

I know how to obtain specific info of the cert used to sign the signature field 1. For example including the following code in signature field 2 preSign event

// Obtain the signature information

var sigInfo = event.target.getField("mySignatureField1").signatureInfo();

// Obtain the certificate:

var cert = sigInfo.certificates[0];

console.println("signer’s common name: " + cert.subjectCN);

console.println("serial number: " + cert.serialNumber);

My doubt is which event should I use to to obtain second signature field certificate information ? 

The preSign event of signature field 2, still doesn't have the info of the certificate used to sign the signatue field2

 

In case I find the rigth event where to get second certificate info, and that both signature fields were signed with the same credential; how should I clear the second signature field ?

Avatar

Employee

Ohh, in that case the validation can be done in postSign and if both fields are signed by same CN and serial number then clear the signature on signature field2

http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=001321.html

--Santosh

http://about.me/nskumar

Avatar

Level 1

Santosh

I can't make it work

The xfa.signature.enumerate(); included in the postSign event of the second signature field always returns 0 as if no signature were included in the form.

Do you have a working example or would you mind to check an example prepared by me?

Regards


Ariel

Avatar

Employee

Please attach the example file that you created.

--Santosh

Avatar

Level 1

Here is published the example file

https://docs.google.com/file/d/0ByU8H00ILIOKOFZLOU9xVjhGdDg/edit?usp=sharing

You can download it to your local machine, once you access the file,

Include your signature on User1 signature field and then use the same certificate to sign the User2 signature field

Thanks for your help!!