Unable to Generate HMac using Salesforce Crypto Class for Google Maps API
My Company recently signed up for Google Maps API for business. To use the API, I need to generte a HMacSHA1 signature, and add it to my HTTP request. Unfortunately, somehow, I am not able to generate the right signature. For testing, I am using the values provided by google to ensure that the algorithm works fine and I get the right result. Here is the code: string url = 'maps/api/geocode/json?address=New+York&sensor=false&client=clientID'; string privateKey = 'vNIXE0xscrmjlyV-12Nj_BvUPaw='; privateKey = privateKey.replace('-', '+'); privateKey = privateKey.replace('_', '/'); //Blob