C# Class Amazon.SimpleNotificationService.Util.Message

This class reads in JSON formatted Amazon SNS messages into Message objects. The messages can also be verified using the IsMessageSignatureValid operation.
Afficher le fichier Open project: aws/aws-sdk-net Class Usage Examples

Private Properties

Свойство Type Description
BuildNotificationStringToSign string
BuildSubscriptionStringToSign string
GetMessageBytesToSign byte[]
GetX509Certificate System.Security.Cryptography.X509Certificates.X509Certificate2
MakeGetRequest void
Message System
ValidateCertUrl string

Méthodes publiques

Méthode Description
IsMessageSignatureValid ( ) : bool

Verifies the authenticity of a message sent by Amazon SNS. This is done by computing a signature from the fields in the message and then comparing the signature to the signature provided as part of the message.

ParseMessage ( string messageText ) : Message

Parses the JSON message from Amazon SNS into the Message object.

SubscribeToTopic ( ) : void

Uses the SubscribeURL property to subscribe to the topic

UnsubscribeFromTopic ( ) : void

Uses the UnsubscribeURL property to unsubscribe from the topic

Private Methods

Méthode Description
BuildNotificationStringToSign ( ) : string

Build the string to sign for SubscriptionConfirmation and UnsubscribeConfirmation messages.

BuildSubscriptionStringToSign ( ) : string

Build the string to sign for Notification messages.

GetMessageBytesToSign ( ) : byte[]
GetX509Certificate ( ) : X509Certificate2
MakeGetRequest ( string url, string action ) : void
Message ( ) : System
ValidateCertUrl ( string certUrl ) : string

Verifies that the signing certificate url is from a recognizable source. Returns the cert url if it cen be verified, otherwise throws an exception.

Method Details

IsMessageSignatureValid() public méthode

Verifies the authenticity of a message sent by Amazon SNS. This is done by computing a signature from the fields in the message and then comparing the signature to the signature provided as part of the message.
public IsMessageSignatureValid ( ) : bool
Résultat bool

ParseMessage() public static méthode

Parses the JSON message from Amazon SNS into the Message object.
public static ParseMessage ( string messageText ) : Message
messageText string The JSON text from an Amazon SNS message
Résultat Message

SubscribeToTopic() public méthode

Uses the SubscribeURL property to subscribe to the topic
public SubscribeToTopic ( ) : void
Résultat void

UnsubscribeFromTopic() public méthode

Uses the UnsubscribeURL property to unsubscribe from the topic
public UnsubscribeFromTopic ( ) : void
Résultat void