-
Notifications
You must be signed in to change notification settings - Fork 0
simpleotp.otpalgorithm
Namespace: SimpleOTP
Represents the hashing algorithm used for One-Time Passwords.
public struct OtpAlgorithmInheritance Object → ValueType → OtpAlgorithm
Implements IEquatable<OtpAlgorithm>, IEquatable<String>, IXmlSerializable
Attributes SerializableAttribute, NullableContextAttribute, NullableAttribute, IsReadOnlyAttribute, JsonConverterAttribute
The HMAC-SHA1 hashing algorithm.
public static OtpAlgorithm SHA1 { get; }The HMAC-SHA256 hashing algorithm.
public static OtpAlgorithm SHA256 { get; }The HMAC-SHA512 hashing algorithm.
public static OtpAlgorithm SHA512 { get; }The HMAC-MD5 hashing algorithm.
public static OtpAlgorithm MD5 { get; }Remarks:
This is not a standard algorithm, but it is defined by IIJ specification and recognized by default.
Internet Initiative Japan. URI format
Initializes a new instance of the OtpAlgorithm struct.
OtpAlgorithm(string value)value String
The algorithm to use.
ArgumentException
Thrown if value is empty or whitespace.
ArgumentNullException
Thrown if value is .
bool Equals(OtpAlgorithm other)other OtpAlgorithm
bool Equals(string other)other String
bool Equals(object obj)obj Object
Determines whether the specified OtpAlgorithm is standard HMAC SHA algorithm (SHA-1, SHA-256 or SHA-512).
bool IsStandard()Boolean
if the specified OtpAlgorithm is standard; otherwise, .
int GetHashCode()Returns the string representation of the OtpAlgorithm struct.
string ToString()String
The string representation of the OtpAlgorithm struct.
XmlSchema GetSchema()XmlSchema
void ReadXml(XmlReader reader)reader XmlReader
void WriteXml(XmlWriter writer)writer XmlWriter
Determines whether the specified OtpAlgorithm is standard HMAC SHA algorithm (SHA-1, SHA-256 or SHA-512).
bool IsStandard(string algorithm)algorithm String
The algorithm to check.
Boolean
if the specified OtpAlgorithm is standard; otherwise, .
Determines whether the specified OtpAlgorithm is standard HMAC SHA algorithm (SHA-1, SHA-256 or SHA-512).
bool IsStandard(OtpAlgorithm algorithm)algorithm OtpAlgorithm
The algorithm to check.
Boolean
if the specified OtpAlgorithm is standard; otherwise, .
©2025 Eugene Fox. Licensed under MIT license