Esempio n. 1
0
        static public Reasons VerifyRequest(string content, string clientSignature, long clientTimeStamp, long maxAllowedStampDiff, X509Certificate2 certificate)
        {
            if (Math.Abs(Utility.CurrentMilliseconds() / 1000 - clientTimeStamp) > maxAllowedStampDiff)
            {
                return(Reasons.BadTime);
            }

            if (clientSignature.Length % 2 != 0 ||
                !SignUtil.Verify(content, clientSignature, certificate))
            {
                return(Reasons.BadSignature);
            }

            return(Reasons.Ok);
        }