Skip to content

simpleotp.hashalgorithmproviders

Eugene Fox edited this page Sep 18, 2024 · 1 revision

HashAlgorithmProviders

Namespace: SimpleOTP

Provides methods for registering and retrieving providers.

public static class HashAlgorithmProviders

Inheritance ObjectHashAlgorithmProviders
Attributes NullableContextAttribute, NullableAttribute

Methods

AddProvider(OtpAlgorithm, KeyedHashAlgorithm)

Registers a new provider.

public static void AddProvider(OtpAlgorithm algorithm, KeyedHashAlgorithm algorithmProvider)

Parameters

algorithm OtpAlgorithm
The algorithm to register.

algorithmProvider KeyedHashAlgorithm
The provider to register.

GetProvider(OtpAlgorithm)

Retrieves a provider.

public static KeyedHashAlgorithm GetProvider(OtpAlgorithm algorithm)

Parameters

algorithm OtpAlgorithm
The algorithm to retrieve.

Returns

KeyedHashAlgorithm
The provider, or null if not found.

RemoveProvider(OtpAlgorithm)

Removes a provider.

public static void RemoveProvider(OtpAlgorithm algorithm)

Parameters

algorithm OtpAlgorithm
The algorithm to remove.

IsRegistered(OtpAlgorithm)

Determines whether a provider is registered.

public static bool IsRegistered(OtpAlgorithm algorithm)

Parameters

algorithm OtpAlgorithm
The algorithm to check.

Returns

Boolean
true if the provider is registered; otherwise, false.

ClearProviders()

Removes all registered providers.

public static void ClearProviders()

Remarks:

This method also clears default providers. Use with caution.

Clone this wiki locally