TheBlueSky.SwiftAuthenticator.Verifier 1.0.0

A simple and straightforward HOTP and TOTP verification library for .NET.

There is a newer version of this package available.
See the version list below for details.
Install-Package TheBlueSky.SwiftAuthenticator.Verifier -Version 1.0.0
dotnet add package TheBlueSky.SwiftAuthenticator.Verifier --version 1.0.0
<PackageReference Include="TheBlueSky.SwiftAuthenticator.Verifier" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TheBlueSky.SwiftAuthenticator.Verifier --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
  1. Create an instance of Authenticator:
var authenticator = new Authenticator();
  1. Create an instance of PasswordVerifier:
var verifier = new PasswordVerifier(authenticator);
  1. Verify password (will successfully verify passwords generated with the default values):
// HMAC-Based One-Time Password (HOTP)
var (isVerified, synchronizationValue) = verifier.VerifyCounterBasedPassword(hotp, secret, 28091977);

// Time-Based One-Time Password (TOTP)
var (isVerified, timeStepDrift) = verifier.VerifyTimeBasedPassword(totp, secret); // assuming totp is generated within the 30-second time step
  1. Create an instance of Authenticator:
var authenticator = new Authenticator();
  1. Create an instance of PasswordVerifier:
var verifier = new PasswordVerifier(authenticator);
  1. Verify password (will successfully verify passwords generated with the default values):
// HMAC-Based One-Time Password (HOTP)
var (isVerified, synchronizationValue) = verifier.VerifyCounterBasedPassword(hotp, secret, 28091977);

// Time-Based One-Time Password (TOTP)
var (isVerified, timeStepDrift) = verifier.VerifyTimeBasedPassword(totp, secret); // assuming totp is generated within the 30-second time step

GitHub repositories (0)

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 300 8/4/2018
1.0.1 261 7/21/2018
1.0.0 390 1/19/2018