private string GetComputedChallenge(string verifier)
 {
     using (var hash = CryptographyHelpers.CreateSHA256())
     {
         return(Base64UrlEncoder.Encode(hash.ComputeHash(Encoding.ASCII.GetBytes(verifier))));
     }
 }
Exemple #2
0
        private HashAlgorithm GetAlgorithm(string hashingAlgorithm)
        {
            switch (hashingAlgorithm)
            {
            case "RS256":
                return(CryptographyHelpers.CreateSHA256());

            default:
                throw new InvalidOperationException($"Unsupported hashing algorithm '{hashingAlgorithm}'");
            }
        }