IOtpService
Namespace: SimpleOTP.DependencyInjection
Provides methods for generating and validating One-Time Passwords.
Attributes NullableContextAttribute
Methods
CreateUri(String, OtpSecret, Int64)
Creates an OTP URI for specified user and secret.
Parameters
username String
The username of the user.
secret OtpSecret
The secret to use.
counter Int64
(only for HOTP) The counter to use.
Returns
Uri
The generated URI.
GenerateCode(OtpSecret, Int64)
Creates an OTP code for specified user and secret.
Parameters
secret OtpSecret
The secret to use.
counter Int64
(only for HOTP) The counter to use.
Returns
OtpCode
ValidateCode(OtpCode, OtpSecret, Int32&, Int64)
Validates an OTP code for specified user and secret.
Parameters
code OtpCode
The code to validate.
secret OtpSecret
The secret to use.
resyncValue Int32&
The resync value. Shows how much the code is ahead or behind the current counter value.
counter Int64
(only for HOTP) The counter to use.
Returns
Boolean
true if the code is valid; otherwise, false.