C# Class OathNet.CounterBasedOtpGenerator

Implements the OATH HOTP algorithm.
Afficher le fichier Open project: jennings/OATH.Net Class Usage Examples

Méthodes publiques

Méthode Description
CounterBasedOtpGenerator ( Key secretKey, int otpLength ) : System

Initializes a new instance of the CounterBasedOtpGenerator class. This is used when the client and server share a counter value.

CounterBasedOtpGenerator ( Key secretKey, int otpLength, IHMACAlgorithm hmacAlgorithm ) : System

Initializes a new instance of the CounterBasedOtpGenerator class. This is used when the client and server share a counter value.

GenerateOtp ( int counter ) : string

Generates the OTP for the given counter value. The client and server compute this independently and come up with the same result, provided they use the same shared key.

Method Details

CounterBasedOtpGenerator() public méthode

Initializes a new instance of the CounterBasedOtpGenerator class. This is used when the client and server share a counter value.
public CounterBasedOtpGenerator ( Key secretKey, int otpLength ) : System
secretKey Key The secret key.
otpLength int The number of digits in the OTP to generate.
Résultat System

CounterBasedOtpGenerator() public méthode

Initializes a new instance of the CounterBasedOtpGenerator class. This is used when the client and server share a counter value.
public CounterBasedOtpGenerator ( Key secretKey, int otpLength, IHMACAlgorithm hmacAlgorithm ) : System
secretKey Key The secret key.
otpLength int The number of digits in the OTP to generate.
hmacAlgorithm IHMACAlgorithm The hashing algorithm to use.
Résultat System

GenerateOtp() public méthode

Generates the OTP for the given counter value. The client and server compute this independently and come up with the same result, provided they use the same shared key.
public GenerateOtp ( int counter ) : string
counter int The counter value to use.
Résultat string