A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/storage/docs/authentication/creating-signatures below:

Create signatures | Cloud Storage

Create signatures

Stay organized with collections Save and categorize content based on your preferences.

This page shows you how to use the Google Cloud signBlob method to create a signature from a string-to-sign or policy document. Signatures are used as credentials in certains requests, such as signed URLs. This guide uses RSA keys for creating signatures.

Important: The Google-managed service account keys used by the signBlob method are rotated regularly. If you set an expiration time for a signature that is greater than 12 hours and generate the signature using the signBlob method, the signature is usable for at least 12 hours, but might stop working prior to the expiration time due to key rotation. Signatures generated using the signBlob method are best used for short-lived access to resources. Before you begin
  1. Enable the Service Account Credentials API.

    Enable the API

  2. You must have the iam.serviceAccounts.signBlob permission for the service account that you use in this guide. The iam.serviceAccounts.signBlob permission is included in the roles/iam.serviceAccountTokenCreator role.

  3. The service account that you use in this guide must have permission to perform the request encoded within the signature. For example, if the signature will be used to read object data from a bucket, the service account must have permission to read the object data.

Create a signature
  1. Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.

  2. Create a JSON file that contains the following information:

    {
      "payload": "REQUEST_INFORMATION"
    }

    Where:

  3. Use cURL to call the IAM API with a signBlob request:

    curl -X POST --data-binary @JSON_FILE_NAME \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/SERVICE_ACCOUNT_EMAIL:signBlob"

    Where:

    If successful, a message digest is returned in the signedBlob field in the response, which is base64 encoded.

  4. To complete the signature, ensure the message digest is base64 decoded, and then hex-encode the message digest.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4