C# Класс OathNet.CounterBasedOtpGenerator

Implements the OATH HOTP algorithm.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

CounterBasedOtpGenerator() публичный Метод

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.
Результат System

CounterBasedOtpGenerator() публичный Метод

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.
Результат System

GenerateOtp() публичный Метод

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.
Результат string