/// <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)); }
/// <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); }
/// <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); }