我正在維護一個VB6 Windows應用程序,它通過啓動位於Acrobat 9.0的Javascript子文件夾中的JS文件對PDF文檔進行數字簽名。現在,我的客戶想要將另一個智能卡讀卡器插入托管該應用程序的個人電腦,其自己的智能卡中包含與將簽署某種類型的文檔的第二個人相關的證書。數字簽名的智能卡選擇
我的問題是:如何以編程方式從我的JavaScript代碼中選擇我想要的智能卡讀取器? 在我的JavaScript代碼,我執行以下操作:
//Initialize the signature handler
var myEngine = security.getHandler("Adobe.PPKLite");
//Obtain the available certificates
var ids = myEngine.digitalIDs;
var myCerts = ids.certs;
//Find the certificate I want to use to sign
for(var j=0; j<myCerts.length; j++)
{
if(myCerts[j].subjectCN == "SMITH JOHN")
{
oCert = myCerts[j];
break;
}
}
//Log to the signature engine by passing the certificate I want to use
//and the slot where the corresponding smart card reader is plugged
myEngine.login({ oParams: { cDIPath: ACROSDK.sigDigitalIDPath,
cPassword: ACROSDK.sigUserPwd,
iSlotID: 1,
oEndUserSignCert: oCert
}
});
//Digitally sign the document with the certificate I chose
sigField.signatureSign({oSig: myEngine,
bUI: false,
oInfo: { password: ACROSDK.sigUserPwd,
location: ACROSDK.sigLocation,
reason: ACROSDK.sigReason,
contactInfo: ACROSDK.sigContactInfo,
appearance: "FirmaRPPR"
}
});
執行signatureSign時,爲什麼我收到一個常規錯誤?在登錄到簽名引擎或cTokenLabel參數時,分配iSlotID參數的正確方法是什麼?
在此先感謝您的幫助和建議!