예제 #1
0
파일: OTP.cs 프로젝트: Injac/AuthServer
        /// <summary>
        /// Get the current OTP value
        /// </summary>
        /// <returns></returns>
        public string GetCurrentOTP()
        {
            HmacSha1 hmacSha1 = new HmacSha1();

            hmacSha1.Init(secretKey);
            hmacSha1.Update(CounterArray);

            byte[] hmac_result = hmacSha1.Final();

            return(FormatOTP(hmac_result));
        }
예제 #2
0
        /// <summary>
        /// Get the current OTP value
        /// </summary>
        /// <returns></returns>
        public string GetCurrentOTP()
        {
            HmacSha1 hmacSha1 = new HmacSha1();

            hmacSha1.Init(secretKey);
            hmacSha1.Update(CounterArray);

            byte[] hmac_result = hmacSha1.Final();

            return FormatOTP(hmac_result);
        }
예제 #3
0
        /// <summary>
        /// Gets the current OTP value
        /// </summary>
        /// <returns>8 digits OTP</returns>
        public string GetCurrentOTP()
        {
            var hmacSha1 = new HmacSha1();

            hmacSha1.Init(_secretKey);
            hmacSha1.Update(CounterArray);
            var hmacResult = hmacSha1.Final();

            return FormatOTP(hmacResult);
        }