GcsSignedUrl.Crypto.sign

You're seeing just the function sign, go back to GcsSignedUrl.Crypto module for more information.
Link to this function

sign(string_to_sign, client)

View Source

Specs

If you pass a %GcsSignedUrl.Client{} as second argument, this function signs the given string with the given client's private key.

If you pass a %GcsSignedUrl.SignBlob.OAuthConfig{} as second argument, this function signs the given string using the signBlob REST API.

(see https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob)

Examples

iex> GcsSignedUrl.Crypto.sign("foo", %GcsSignedUrl.Client{private_key: "-----BEGIN RSA PRIVATE KEY-----..."})
"..."

iex> GcsSignedUrl.Crypto.sign("foo", %GcsSignedUrl.SignBlob.OAuthConfig{access_token: "..."})
{:ok, "1fad6186e41f577a37f56589..."}