This page explains how to install and use the GCrypt COM object for Google Checkout ASP implementations. The GCrypt COM object performs base64 encoding and calculates HMAC-SHA1 signatures for Checkout API requests. You may use this object in your implementations or write your own COM object to perform these functions.
Since ASP does not have built-in functions for base64 encoding and generating HMAC-SHA1 signatures, Google Checkout merchants with ASP implementations need to use a COM object for these functions.
Merchants who use the GCrypt COM object will use the base64Encode function to encode a text string and the generateSignature function to generate the HMAC-SHA1 signature. The following code snippet demonstrates how you would call these functions in your application. This code appears in the GlobalAPIFunctions.asp file.
Set cryptObj = Server.CreateObject("GCrypt.g_crypt.2")
' Base64 encode the cart XML
b64cart = cryptObj.base64Encode(xmlCart)
'Generate a digital signature with the cart XML and merchant key
b64signature = cryptObj.generateSignature(xmlCart, strMerchantKey)
The GCryptInstaller.MSI file will automatically install the GCrypt COM object onto your Windows-based server. After the installation has completed, you will need to assign proper authorizations to the component so that it can be executed from your ASP pages.
-
Download the .MSI file to the Windows computer where you wish to install the COM object
-
Double-click the .MSI file to launch the installation program.
-
You may receive a warning message that the COM may contain viruses -- ignore the warning and continue.
-
The installation will only take a few seconds to execute. It will not display a message indicating that the installation has completed. Wait around 10 to 15 seconds for the installation to complete before proceeding to assign a user authorization to the COM.
-
To assign a user authorization, open the Control Panel -> Administrative Tools window.
-
Click on Component Services -> Computers -> My Computer -> COM+ Applications. You should see a component called GCrypt in this folder.
-
Right-click on the GCrypt component and choose Properties, then click on the Identity tab. The default value for the identity should be System Account.
-
Click on the This user radio button and enter the username and password information for a user account to which you want to grant access to run this component. Note: The user does not have to be an "Administrator" account and can simply be a member of "Users".
-
Exit out of Component Services and close all related windows.
The user who has been granted access to the COM object should now be able to properly execute the GCryptInstallationTest.asp to verify that the object functions correctly.
