Newbie question with BESAPI.SigningKeys

(imported topic written by jpg91)

Hi,

I’m trying to get a project going. We’re having troubles starting with the client examples (TestAPI.htm) and setting up our infrastructure. I’m trying to validate my publisher.pvk, publisher.crt, and license.crt with a BESAPI.SigningKeys ActiveXObject. I can set the paths successfully, but I’m running into troubles querying AreSigningKeysValid. I’m sure it’s a misconfig issue (hopefully).

I’m receiving the following DiagnosticMessage: These signing keys are not valid. They may be inconsistent with the database you are connecting to, may be for a different operator, or may have been revoked. Please verify that you have selected valid key and license files and try again.

I’m setting up the call as follows:

function CheckSigningKeys()

{

var sk = new ActiveXObject(“BESAPI.SigningKeys”);

var folder = window.prompt("Signing Key Folder Path for user bigfix (must include trailing slash): ");

sk.SetPrivateKeyPath(“john”,folder + “publisher.pvk”);

sk.SetPublisherCertPath(“john”,folder + “publisher.crt”);

sk.SetLicenseCertPath(“john”,folder + “license.crt”);

if (sk.AreSigningKeysValid(“john”,window.prompt("Password for user bigfix: ")))

{

window.alert(“Valid!”);

} else {

var msg = "Diagnostic Message: " + sk.DiagnosticMessage;

if (msg != "Diagnostic Message: ") {

window.alert(msg);

}

}

}

Now, if I pass an invalid password, I receive a different DiagnosticMessage. I’ve verified that these are indeed my publisher files. I’m pointing to our site license, and I’m sure it is valid, and my user is active.

I’m running BES 7.0.9.164.

Any help is appreciated.

(imported comment written by BenKus)

BigFix 7.0.9? You really should consider upgrading to 7.2.5…

Try setting the DSN values before you call your functions:

var dsnname = “bes_bfenterprise”;
sk.SetDefaultDSN(dsnname);

Ben

(imported comment written by jpg91)

Thanks Ben,

The DSN Values are set up in another part of the program. Thanks for the tip, but I’m not sure it’s relevant here within this function… Anyway, no change. I still receive the same DiagnosticMessage.

I don’t suppose there’s any way to know which file AreSigningKeysValid is barfing on? I’ve tried interspersing lookups on DiagnosticMessage as I set each path, but it’s null until I enter the if block.

I’ll put an ugrade on the table but was really looking for a working example of BESAPI.

Thanks!

John