OpenTokApi.Core.OpenTok.SignString C# (CSharp) 메소드

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

private static SignString ( string message, string key ) : string
message string
key string
리턴 string
        private static string SignString(string message, string key)
        {
            var encoding = new ASCIIEncoding();

            var keyByte = encoding.GetBytes(key);

            var hmacsha1 = new HMACSHA1(keyByte);

            var messageBytes = encoding.GetBytes(message);
            var hashmessage = hmacsha1.ComputeHash(messageBytes);

            // Make sure to utilize ToLower() method, else an exception willl be thrown
            // Exception: 1006::Connecting to server to fetch session info failed.
            string result = ByteToString(hashmessage).ToLower();

            return result;
        }