Table of Contents

Class SmsSignatureGenerator

Namespace
Vonage.Cryptography
Assembly
Vonage.dll

Generates the signature applied to SMS API requests when using signed-request authentication. The resulting signature is sent as the sig parameter so the Vonage API can verify the request originated from the holder of the signature secret.

public class SmsSignatureGenerator
Inheritance
SmsSignatureGenerator
Inherited Members

Remarks

Configure the desired hashing SmsSignatureGenerator.Method on Credentials via FromApiKeySignatureSecretAndMethod(string, string, Method). HMAC variants are preferred over the legacy md5hash mode.

Methods

GenerateSignature(string, string, Method)

Generates a request signature using the supplied hashing method.

public static string GenerateSignature(string query, string securitySecret, SmsSignatureGenerator.Method method)

Parameters

query string

The request query string to sign (parameters concatenated as &key=value pairs).

securitySecret string

The signature secret from your Vonage account dashboard.

method SmsSignatureGenerator.Method

The hashing method used to compute the signature.

Returns

string

The hexadecimal signature. md5hash returns lowercase MD5 of query + secret; the HMAC variants return the uppercase HMAC of the query keyed by the secret.