AdventureWorks.WebServices.Tests.Controllers.IdentityControllerFixture.CreatePasswordHash C# (CSharp) 메소드

CreatePasswordHash() 개인적인 정적인 메소드

private static CreatePasswordHash ( string password, string challengeString ) : string
password string
challengeString string
리턴 string
        private static string CreatePasswordHash(string password, string challengeString)
        {
            var passwordBuffer = Encoding.UTF8.GetBytes(password);

            // same as MacAlgorithmProvider.OpenAlgorithm(MacAlgorithmNames.HmacSha512).CreateKey(passwordBuffer) in Windows Runtime.
            var provider = new HMACSHA512(passwordBuffer);

            // Same as CryptographicBuffer.DecodeFromHexString in Windows Runtime.
            var challengeBuffer = DecodeFromHexString(challengeString);

            // same as CryptographicEngine.Sign(provider, challengeBuffer) in Windows Runtime.
            var hmacBytes = provider.ComputeHash(challengeBuffer);

            // Same as CryptographicBuffer.EncodeToHexString in Windows Runtime.
            return EncodeToHexString(hmacBytes);
        }
        #endregion