GcsSignedUrl.Crypto.sign
You're seeing just the function
sign
, go back to GcsSignedUrl.Crypto module for more information.
Specs
sign(String.t(), GcsSignedUrl.Client.t()) :: String.t()
sign(String.t(), GcsSignedUrl.SignBlob.OAuthConfig.t()) :: {:ok, String.t()} | {:error, String.t()}
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..."}