public virtual string Verify(string challenge)
 {
     var match = Regex.Match (challenge, @"^[a-f0-9]{20,32}$");
     if (!match.Success)
     {
         throw new InvalidChallengeException ("challenge contains non-hex characters");
     }
     string digest = new Sha1Hasher().HmacHash(service.PrivateKey, challenge);
     return string.Format("{0}|{1}", service.PublicKey, digest.ToLower());
 }
        public virtual string Verify(string challenge)
        {
            var match = Regex.Match(challenge, @"^[a-f0-9]{20,32}$");

            if (!match.Success)
            {
                throw new InvalidChallengeException("challenge contains non-hex characters");
            }
            string digest = new Sha1Hasher().HmacHash(service.PrivateKey, challenge);

            return(string.Format("{0}|{1}", service.PublicKey, digest.ToLower()));
        }
示例#3
0
        public virtual string Verify(string challenge)
        {
            string digest = new Sha1Hasher().HmacHash(Service.PrivateKey, challenge);

            return(String.Format("{0}|{1}", Service.PublicKey, digest.ToLower()));
        }