C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
BuildNotificationStringToSign string
BuildSubscriptionStringToSign string
GetMessageBytesToSign byte[]
GetX509Certificate System.Security.Cryptography.X509Certificates.X509Certificate2
MakeGetRequest void
Message System
ValidateCertUrl string

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

IsMessageSignatureValid() публичный Метод

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
Результат bool

ParseMessage() публичный статический Метод

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
Результат Message

SubscribeToTopic() публичный Метод

Uses the SubscribeURL property to subscribe to the topic
public SubscribeToTopic ( ) : void
Результат void

UnsubscribeFromTopic() публичный Метод

Uses the UnsubscribeURL property to unsubscribe from the topic
public UnsubscribeFromTopic ( ) : void
Результат void