The Amazon SNS Message Validator for PHP allows you to validate that incoming HTTP(S) messages are legitimate SNS notifications. This library does not depend on the AWS SDK for PHP or Guzzle, but it does require that the OpenSSL PHP extension be installed.
<?php
require 'vendor/autoload.php';
use Aws\Sns\Message;
use Aws\Sns\MessageValidator;
$message = Message::fromRawPostData();
// Validate the message
$validator = new MessageValidator();
if ($validator->isValid($message)) {
// do something with the message
}
A special thanks goes out to Julian Vidal who helped create the initial implementation in Version 2 of the AWS SDK for PHP.