namespace SimpleOTP.DependencyInjection; /// /// Provides methods for generating and validating One-Time Passwords. /// public interface IOtpService { /// /// Creates an OTP URI for specified user and secret. /// /// The username of the user. /// The secret to use. /// (only for HOTP) The counter to use. /// The generated URI. public Uri CreateUri(string username, OtpSecret secret, long counter = 0); /// /// Creates an OTP code for specified user and secret. /// /// The secret to use. /// (only for HOTP) The counter to use. public OtpCode GenerateCode(OtpSecret secret, long counter = 0); /// /// Validates an OTP code for specified user and secret. /// /// The code to validate. /// The secret to use. /// The resync value. Shows how much the code is ahead or behind the current counter value. /// (only for HOTP) The counter to use. /// true if the code is valid; otherwise, false. public bool ValidateCode(OtpCode code, OtpSecret secret, out int resyncValue, long counter = 0); }