diff options
author | Stephen Jennings <Stephen.G.Jennings@gmail.com> | 2011-11-12 23:35:07 -0800 |
---|---|---|
committer | Stephen Jennings <Stephen.G.Jennings@gmail.com> | 2011-11-13 13:15:31 -0800 |
commit | 594166213822635486e63e4085486c5f736ece4c (patch) | |
tree | 67f4117626464f564cd27a39080ed4cd8ec30e9c | |
parent | b94916571fbc845cdbe5a688b32c7e8f88c2fdd3 (diff) | |
download | OATH.Net-594166213822635486e63e4085486c5f736ece4c.zip OATH.Net-594166213822635486e63e4085486c5f736ece4c.tar.gz OATH.Net-594166213822635486e63e4085486c5f736ece4c.tar.bz2 |
Update usage.
-rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -17,7 +17,8 @@ OATH.Net is a .NET library to perform OATH authentication. int otpDigits = 8; int counterValue = user.NextCounterValue(); - CounterBasedOtp otp = new CounterBasedOtp(secretKey, otpDigits); + Key key = new Key(secretKey); + CounterBasedOtpGenerator otp = new CounterBasedOtpGenerator(key, otpDigits); string validCode = otp.ComputeOtp(counterValue); return userSuppliedCode == validCode; @@ -28,7 +29,8 @@ OATH.Net is a .NET library to perform OATH authentication. string secretKey = user.SecretKey; int otpDigits = 8; - TimeBasedOtp otp = new TimeBasedOtp(secretKey, otpDigits); + Key key = new Key(secretKey); + TimeBasedOtpGenerator otp = new TimeBasedOtpGenerator(key, otpDigits); string validCode = otp.ComputeOtp(DateTime.UtcNow); return userSuppliedCode == validCode; |