public bool Verify(SAuthInfo response, string itemId) { RSACryptoServiceProvider csp = retrieveCryptoServiceProvider(); string verificationMessage = getVerificationMessage(response, itemId); byte[] hash = getSha256Hash(verificationMessage); byte[] signature = HexStringToByteArray(response.signature); return(csp.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA256"), signature)); }
// @MBills documentation private string getVerificationMessage(SAuthInfo response, string itemId) { return(this.apiKey + response.nonce + response.timestamp + itemId); // itemId is e.g. transactionId }