/// <summary> /// Initialize an OTP instance with the shared secret generated on Registration process /// </summary> /// <param name="secret"> Shared secret </param> /// <param name="clock"> Clock responsible for retrieve the current interval </param> public Totp(string secret, Clock clock) { this.secret = secret; this.clock = clock; }
public void TestClock() { //given var clock = new Clock(1); //when var interval = clock.CurrentInterval; //then //interval is bigger then the one from now Assert.IsTrue(interval > 1443013417L); }
/// <summary> /// Initialize an OTP instance with the shared secret generated on Registration process /// </summary> /// <param name="secret"> Shared secret </param> public Totp(string secret) { this.secret = secret; clock = new Clock(); }