static bool VerifySignature(string signature, bool usePrimaryKey, Func <string> stringToSign) { if (!SharedKeySignature.HasKey(usePrimaryKey)) { return(false); } else if (signature == SharedKeySignature.GenerateSignature(stringToSign, usePrimaryKey)) { return(true); } return(false); }
private static bool VerifyRequestAuthorization(string signature, bool usePrimaryKey, bool liteAlgorithm, string method, string uriPath, RequestHeaders headers, RequestQueryParameters queryParams, string requestDate, string contentLength) { if (!SharedKeySignature.HasKey(usePrimaryKey)) { return(false); } else if (signature == GenerateSignature(usePrimaryKey, liteAlgorithm, method, uriPath, headers, queryParams, requestDate, contentLength)) { return(true); } return(false); }