Previous Topic: AddCurrentCardToWallet()Next Topic: CreateOfflineKeyBag()


AttachCertToCurrentCard()

This method is used as part of the client-side key generation. AttachCertToCurrentCard() is used to attach the newly generated certificate to the card, where the keys were generated from GetErrorCode().

After this method, AddCurrentCardToWallet() needs to be invoked to add the new card to a wallet and store the wallet to the user's machine.

Syntax

string AttachCertToCurrentCard(certificateEncoding)

Parameters

The following are the parameters of this method:

Parameter

Type

Description

certificateEncoding

string

Base-64 encoded certificate you wish to attach to the current card.

Returns

If the method is successful, then it returns TRUE. If the method is unsuccessful, then it returns FALSE.

Example

var arcotClient = new ArcotClient();
var b64certString = "MIIFeQIBAAwHcGlucGFkMTCCBWcwggVjAgEBDAR
                     jYXJkoIHFMB8GCmCGSAGG+UYJAQEwEQQAAgEBAg
                     ILAgICAegCAgMYBIGhMIGeAgEAMA4GCmCGSAGG+
                     UYJAgAFAASBiDCBhQJBAM4mHRH5WMYDjDPUZD16...";

if (arcotClient.AttachCertToCurrentCard(b64certString))
{
    document.write("<P> AttachCertToCurrentCard succeeded</P>");
}
else
{
    document.write("<P> AttachCertToCurrentCard failed</P>");
}