Exemplo n.º 1
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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }