Previous Topic: GetVersion()Next Topic: SetAttribute()


GetGlobalAttribute()

Retrieves attribute values from the plug-in, applet, or from a specific ArcotID PKI. Not all ArcotID PKI attributes can be retrieved by using this API.

Syntax

string GetGlobalAttribute(attributeName)

Parameters

The following are the parameters of this method:

Parameter

Type

Description

attributeName

string

The attribute you are requesting.

Returns

If successful, then it returns the Arcot card attribute you requested.

Discussion

Attributes allow you to set information that will persist in the plug-in till the browser session is closed. You can create your own attributes by using SetAttribute() or you can use special pre-defined attributes to obtain specific information about Arcot wallets and cards. Pre-defined attributes include:

Attribute

Description

SelectedWalletName

Set by the plug-in when the user attempts to renew their card.

SelectedCardName

Set by the plug-in when the user attempts to renew their card.

walletn:count

Indicates the number of ArcotID PKIs present on the client.

walletn:x

Selects a specific Arcot card within the wallet. The cards are numbered 0 - X.

walletn:x:name

Indicates the name of specific wallet.

walletn:x:cardn:count

Indicates the number of cards in the specific wallet.

Note: Usually only one card is present in an wallet.

walletn:x:cardn:x:name

Indicates the name of the specific card in the particular wallet.

wallet:walletname:card:cardname::walletDER

Returns the DER encoding of the wallet with the specified wallet name and card name.

Note: This requires a domain check to be done on the client to ensure the Web page in use is from the correct domain.

walletn:x:cardn:x:serialnumber

Fetches the serial number from the Arcot certificate present in the specified card of the wallet. The serial number is always in the hexadecimal format.

Note: This function will succeed if the DNS domain of the current Web page matches the DNS domain of the given ArcotID PKI.

Example

var arcotClient = new ArcotClient();
var i = 0;
var walletname;

// Get the number of wallets
var walletcount = arcotClient.GetGlobalAttribute("walletn.count");

// Print out the names of all the wallets
for (i = 0; i < walletcount; i++)
{
    walletname = arcotClient.GetGlobalAttribute("wallet." + i +  ":name");
    document.write("<P>" + walletname + "</P>");
}