Created
March 26, 2016 13:58
-
-
Save keichan34/c7db8ed3ca704a6c9180 to your computer and use it in GitHub Desktop.
Amazon SES SMTP Credential Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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