Tinku
Tinku

Reputation: 53

How to generate a signed url for GCP to download a file in Java?

How to generate a signed url for GCP to download a file in Java/SpringBoot API?

Basically if we have generated gsutil url is as below -

https://storage.googleapis.com/test_bucket/Test_Document.xlsx?
x-goog-signature=55a0aaswd54a54b41t66161f351yfdbfd248b3383cb55c593050a751761bd8441d79b64
&x-goog-algorithm=GOOG4-RSA-SHA256
&x-goog-credential=abc.gserviceaccount.com%2F202208
&x-goog-date=20220809T134421Z
&x-goog-expires=1800
&x-goog-signedheaders=host

And, I am trying to convert the above gsutil command in Java program by forming the canonical query string. But I am not getting way to generate the value for x-goog-signature?

Please help in getting in creating signed url.

Upvotes: 1

Views: 2296

Answers (1)

Andrés
Andrés

Reputation: 515

See the Java Code Sample tab to create a signed URL that can get an object from a bucket.

Upvotes: 2

Related Questions