Generating Base-64 SHA-1 Signature Header for Rackspace API in Apex

This post shares small code snippet to generate base-64 SHA1 Hash, which is typically used in passing as signature header to some APIs. We tested this snippet with Rackspace API Signature Header, which requires a base-64 SHA1 Hash.

The key point to note here is we need to encode the binary hash, not the hex hash, into base-64 and thus the resulting string should be 28 characters long. Here is the gist snippet to generate the hash

Read More: https://abhinav.fyi/generating-base-64-sha-1-signature-header-for-rackspace-api-in-apex/

Abhinav Gupta

First Indian Salesforce MVP, rewarded Eight times in a row, has been blogging about Salesforce, Cloud, AI, & Web3 since 2011. Founded 1st Salesforce Dreamin event in India, called “Jaipur Dev Fest”. A seasoned speaker at Dreamforce, Dreamin events, & local meets. Author of many popular GitHub repos featured in official Salesforce blogs, newsletters, and books.

https://abhinav.fyi
Previous
Previous

Take aways from Salesforce Noida Developer Meetup !

Next
Next

Upcoming Salesforce Dev events in India (July’12)