Search code examples
c#google-cloud-platformgoogle-cloud-storagehmac

Upload file to Google Cloud Storage using HMAC key in c#


I have files in a Google Cloud Storage bucket that I need to move to a customers GCS bucket. They provided HMAC keys (access id and secret). I'm familiar with using the c# API libraries but they require a JSON or p12 file to authenticate. I'm not sure how to use the HMAC keys. From my research it looks like I may need to use the GSC XML API. Does anyone know how to authenticate using HMAC keys?


Solution

  • Suggestion #1:

    Ask the customer for a service account JSON key. Since both the source and destination bucket are in Google Cloud Storage, this is the best solution.

    Suggestion #2:

    Use AWS S3 boto libraries with AWS style Access ID and Secret to access Google Cloud Storage. Google supports AWS S3 emulation (XML API).

    AWS SDK for .NET