Last active
February 14, 2018 20:00
-
-
Save dsantuc/2b2947847baead5407d629ed1ad4e210 to your computer and use it in GitHub Desktop.
Deriving Amazon SES SMTP credentials from IAM credentials in PHP.
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
function getSMTPPassword ($key) { | |
$message = "SendRawEmail"; | |
$hexVersion = "02"; | |
$hexSignature = hash_hmac("sha256", $message, $key); | |
return base64_encode(hex2bin($hexVersion . $hexSignature)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As described here:
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#smtp-credentials-convert