Skip to content

Instantly share code, notes, and snippets.

@keichan34
Created March 26, 2016 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keichan34/c7db8ed3ca704a6c9180 to your computer and use it in GitHub Desktop.
Save keichan34/c7db8ed3ca704a6c9180 to your computer and use it in GitHub Desktop.
Amazon SES SMTP Credential Generator
#!/usr/bin/env elixir
Application.start(:crypto)
key = case System.argv do
[key | _] -> key
_ ->
IO.puts "Usage: ses_credential_generator.exs [AWS Secret Access Key]"
exit(:shutdown)
end
signature = :crypto.hmac(:sha256, key, "SendRawEmail")
smtp_password = Base.encode64(<<02>> <> signature)
IO.puts smtp_password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment