Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Implementation of Signed Data Generation

 

I am working on a project that involves integrating with an API endpoint for user registration. Currently, I have deployed a Cloud Run service with a URL that receives the requests. I have stored the private and public keys in Secret Manager, and I need to fetch them for use. The API requires signed data as part of the request payload, and I need guidance on implementing the signed data generation correctly.

Solved Solved
0 1 155
1 ACCEPTED SOLUTION

Hi @Nikita_G,

You're on the right track with using Cloud Run and Secret Manager for securing API interaction. Here's a comprehensive breakdown on how to implement signed data generation and integrate with your API endpoint:

1. Fetching Keys from Secret Manager

  • Cloud Run Environment Variables: Store the Secret Manager secret names as environment variables in your Cloud Run service.
  • Fetching Secrets: In your Cloud Run service’s code, use the Google Cloud client library for Secret Manager to retrieve the secrets.

2. Implementing Signed Data Generation

3. Verification on the API Side

  • Extract Signature: The API endpoint will extract the provided signature from the request payload.
  • Validate Signature: The API endpoint will use the public key to verify the signature against the provided data using the same signing algorithm and parameters.
  • Handle Errors: The API should handle errors during signature verification and respond accordingly

I hope the above information is helpful.

View solution in original post

1 REPLY 1

Hi @Nikita_G,

You're on the right track with using Cloud Run and Secret Manager for securing API interaction. Here's a comprehensive breakdown on how to implement signed data generation and integrate with your API endpoint:

1. Fetching Keys from Secret Manager

  • Cloud Run Environment Variables: Store the Secret Manager secret names as environment variables in your Cloud Run service.
  • Fetching Secrets: In your Cloud Run service’s code, use the Google Cloud client library for Secret Manager to retrieve the secrets.

2. Implementing Signed Data Generation

3. Verification on the API Side

  • Extract Signature: The API endpoint will extract the provided signature from the request payload.
  • Validate Signature: The API endpoint will use the public key to verify the signature against the provided data using the same signing algorithm and parameters.
  • Handle Errors: The API should handle errors during signature verification and respond accordingly

I hope the above information is helpful.