Class SharedKeyService
Provides a service to authenticate requests using shared keys.
Inheritance
SharedKeyService
Assembly: DataWeb.Core.dll
Syntax
public class SharedKeyService : ISharedKeyService
Methods
Generates a dictionary of HTTP headers for authenticating a request.
Declaration
public Dictionary<string, string> GetHttpHeaders(Uri url, string appName, string secretKey, string httpMethod)
Parameters
Returns
GetSignature(string, string)
Computes the signature of the provided data using the provided secret key.
Declaration
public string GetSignature(string data, string sectretKey)
Parameters
Returns
GetStamp()
Retrieves the current Unix timestamp.
Declaration
Returns
IsValidRequest(string, string, string, ulong, string, string, string, ulong)
Validates if a request is valid based on the provided parameters.
Declaration
public bool IsValidRequest(string appName, string secretKey, string requestAppName, ulong requestStamp, string requestSignature, string requestUrl, string requestMethod, ulong seconds = 900)
Parameters
Returns
ValidateStamp(ulong, ulong)
Validates if the request timestamp is within the specified time range.
Declaration
public bool ValidateStamp(ulong requestStamp, ulong seconds)
Parameters
Type |
Name |
Description |
ulong |
requestStamp |
|
ulong |
seconds |
|
Returns
Implements