A.3. Enterprise Security Client XUL and Javascript Functionality
Enterprise Security Client stores the XUL markup and Javascript functionality in the ESC_INSTALL_PATH/chrome/content/esc directory, where ESC_INSTALL_PATH is the Enterprise Security Client installation directory.
The following are the primary Enterprise Security Client XUL files:
settings.xul contains the code for the Settings page.
esc.xul contains the code for the Enrollment page.
config.xul contains the code for the configuration UI.
esc_browser.xul contains the code for hosting the external HTML Enterprise Security Client enrollment UI.
The following are the primary Enterprise Security Client Javascript files:
ESC.js contains most of the Enterprise Security Client Javascript functionality.
TRAY.js contains the tray icon functionality.
CertInfo.js contains the code for Show Key Info feature.
GenericAuth.js contains the code for the authentication prompt. This prompt is configurable from the TPS server, which requires dynamic processing by Enterprise Security Client.
Certificate System 7.1 deployments may be using a customized external UI for key enrollment. Changes have been made to the names of internal Enterprise Security Client XPCOM objects in later versions of Certificate System, so changes need to be made to the ESC.js file to adapt an older UI. The places for these changes are shown in the file section below.
//ESC.js : Core Enterprise Security Client functionality
....
//
// Attach to the Enterprise Security Client XPCOM object on load
//
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
gNotify = new jsNotify;
netkey.rhCoolKeySetNotifyCallback(gNotify);
} catch(e) {
alert("Can't get UniversalXPConnect: " + e);
}
//Sample function to complete Enrollment of a key.
function EnrollCoolKey(keyType, keyID, enrollmentType, screenname,
pin,screennamepwd,tokencode)
{
try {
netkey.EnrollCoolKey(keyType, keyID, enrollmentType, screenname,
pin,screennamepwd,tokencode);
} catch(e) {
ReportException("netkey.EnrollCoolKey() failed!", e);
return false;
}
return true;
}