Skip to content

Instantly share code, notes, and snippets.

@dsantuc
Last active February 14, 2018 20:00
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 dsantuc/2b2947847baead5407d629ed1ad4e210 to your computer and use it in GitHub Desktop.
Save dsantuc/2b2947847baead5407d629ed1ad4e210 to your computer and use it in GitHub Desktop.
Deriving Amazon SES SMTP credentials from IAM credentials in PHP.
function getSMTPPassword ($key) {
$message = "SendRawEmail";
$hexVersion = "02";
$hexSignature = hash_hmac("sha256", $message, $key);
return base64_encode(hex2bin($hexVersion . $hexSignature));
}
@dsantuc
Copy link
Author

dsantuc commented Oct 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment