1
0
mirror of https://github.com/XFox111/SimpleOTP.git synced 2026-04-22 08:00:45 +03:00
1
simpleotp.fluent.otpfluentextensions
Eugene Fox edited this page 2024-09-18 16:16:09 +03:00

OtpFluentExtensions

Namespace: SimpleOTP.Fluent

Provides fluent API for configuring Otp objects.

public static class OtpFluentExtensions

Inheritance ObjectOtpFluentExtensions
Attributes NullableContextAttribute, NullableAttribute, ExtensionAttribute

Methods

WithNewSecret(Otp, Int32)

Creates a new Otp object from the provided OtpConfig

public static Otp WithNewSecret(Otp generator, int bytesLength)

Parameters

generator Otp
The Otp object to configure.

bytesLength Int32
The length of the secret in bytes.

Returns

Otp
The configured Otp object.

WithSecret(Otp, OtpSecret)

Creates a new Otp object from the provided OtpSecret

public static Otp WithSecret(Otp generator, OtpSecret secret)

Parameters

generator Otp
The Otp object to configure.

secret OtpSecret
The OtpSecret to use.

Returns

Otp
The configured Otp object.

WithDigits(Otp, Int32)

Sets the Otp.Digits property.

public static Otp WithDigits(Otp generator, int digits)

Parameters

generator Otp
The Otp object to configure.

digits Int32
The number of digits to use in OTP codes.

Returns

Otp
The configured Otp object.

WithAlgorithm(Otp, OtpAlgorithm)

Sets the Otp.Algorithm property.

public static Otp WithAlgorithm(Otp generator, OtpAlgorithm algorithm)

Parameters

generator Otp
The Otp object to configure.

algorithm OtpAlgorithm
The algorithm to use.

Returns

Otp
The configured Otp object.