Copy link to clipboard
Copied
Hello All,
thaks for your help!
I have question regarding Digitial Signature, I create a custom script for the Digital Siganure and it's working fine, but I'm passing the null user name and Passoword/ wrong password it open
the above page, is there any way we can hide this or disable it.
I'm using the below box to pass the user name and passoword.
Hey mlz123456!
Sorry for taking this long to reply back but I had to read a lot.
I've consulted the "Acrobat JavaScript Scripting Reference", the Acrobat JavaScript API Reference Guide", and also with the Acrobat Enterprise Toolkit - Preferences Reference", and the "Digital Signatures User Guide for the Acrobat Family of Products: A guide for IT and enterprise users".
Your main question have a yes and no answer, depending on which context we're referring to.
Copy link to clipboard
Copied
I am not sure if this actually possible ( I may be wrong), but maybe in your script set the user interface parameter to false.
bUI: false,
See example below taken from the Adobe Acrobat SDK JavaScript API API Reference, " Field methods" page 434
var f = this.getField( "AuthorSigFieldName" );
var s = { reason: "I am the author of this document",
mdp: "allowNone" };
f.signatureSign({
oSig: myEngine,
oInfo: s,
bUI: false,
cLegalAttest: "To reduce file size, fonts are not embedded."
});
Is this on macOS or MS Windows? And what script are you using? Do you mind sharing your script?
In addition in MS Windows it seems to be possible to disable the option to create self-signed certificates. To do so disable this key: bSelfSignCertGen
You need the Adobe AcrobatPreferences Reference: https://www.adobe.com/devnet-docs/acrobatetk/tools/PrefRef/Windows/Security.html
This won't allow the ability for users to choose to create their own self-sign certificates.
Copy link to clipboard
Copied
Hello Thanks for your help.
if(this.getField().value.length == 0)
{
// get the logged in user
var passwordcorrect=0;
while(passwordcorrect<=0)
{
cRtn = app.response ({ cQuestion:"Enter your Username:", cTitle:"Your Digital Signature", bPassword:false, cDefault: newusername, cLabel:"username"});
newusername = cRtn
cRtn1 = app.response ({ cQuestion:"Enter your password for Username:", cTitle:"Your Digital Signature Password", bPassword:true, cDefault: "", cLabel:"Password"});
passforfield = cRtn1
if(cRtn1.length && cRtn.length)
{
var ppklite = security.getHandler("Adobe.PPKLite");
// find the certificate and path
var Certicatename=cRtn.concat(".pfx")
var pathname="/C/Adobe/DigitalID/";
var fullpathname=pathname.concat(Certicatename);
try
{
ppklite.login(cRtn1, fullpathname);
passwordcorrect=1;
// Set focus on a signature field
var f = this.getField(clickedFieldname);
// Sign it and log out. Change as appropriate
f.signatureSign(ppklite,{password:cRtn1,location: "NA",
reason: "I am signing for this step",
contactInfo: "",
appearance: ""});
// Required if the password is available
ppklite.logout();
}
it's the half part of my script, my script is working.. I have tried as you suggested but that is not working
Thanks
Copy link to clipboard
Copied
Hey mlz123456!
Sorry for taking this long to reply back but I had to read a lot.
I've consulted the "Acrobat JavaScript Scripting Reference", the Acrobat JavaScript API Reference Guide", and also with the Acrobat Enterprise Toolkit - Preferences Reference", and the "Digital Signatures User Guide for the Acrobat Family of Products: A guide for IT and enterprise users".
Your main question have a yes and no answer, depending on which context we're referring to.
No. It is not possible to hide and it is not possible to disable it.
What is possible though, is that you can switch the appearance of that dialogue box via registry keys (or Plist if on macOS), or you can do it manually by going to EDIT--->> PREFEERNCES--->>SIGNATURES--->>> "Creation & Appearacnce" -->> click on "More". In the next dialogue box un-tick the box "Use modern interface for signing and Digital ID configuration".
See slide:
The problem with that is, that this setting is not locakble, meaning that, users can toggle this preference locally in their desktop. And it won't be retained with that document unless you figure out how to embedd the setting with the PDF, save the file with reader enabled rigths and restrict (encrypt) with password to prevent editing.
In your case, if this is at work, one available avenue is to disable that preference setting via Group Policy and the Acrobat t Cutomization Wizard (during installation time). This will prevent all users from messing around with it.
The registry keys that need to be disabled are discussed here: Enterprise Toolkit | Windows Registry Reference - Signing: Appearances
See quote below:
From further reading, it is possible to avoid the annoying Sign Document dialogue if you add to your current script another small script to create the signature field for the user rather than having the user right-click and sign on a pre-existing signature field.
See this brief tutorial by Thom Parker:
I think this is the way to go to resolve your issue.
There's a lot more that you can also try by using the seedValue of a signature field to apply filters, and/or manipulate Signature Handlers so that the user will not be able to sign if the Signature Appearance doesnt match a specific filter, for example.
In this case the dialogue box won't allow to continue any further, which you can terminate via script and the user will be forced to re-enter user name and password again, then select the correct certificate (if more than one is shared per user) .
See this quote taken from this deprecated guide : https://www.adobe.com/devnet-docs/etk_deprecated/tools/DigSig/Acrobat_DigSig_WorkflowGuide.pdf
Example 6.3: Seed value: signatureAppearance
f = this.getField("Field Name");
f.signatureSetSeedValue({AppearanceFilter:"Example Appearance Name"});
//Set the setting as required
f.signatureSetSeedValue({AppearanceFilter:"Example Appearance Name", flags:
0x100});
I tested this script in my form and it works phenomenally to achieve this purpose. It will not allow the user to go any further.
This would be the way to go if you decide to continue to use the Sign Document dialogue. But in my humble opinion this route doesn't address your inquiry. I would would stick to Thom Parker's method and create a signature field for the user that you can restrict at signing time.