Skip to content

ValidateCode Method ​

Definition ​

  • Namespace: JASE.Crypto
  • Assembly: JASE.Crypto.dll

bool ValidateCode(string code, DateTime? timestamp = null, int allowedSkew = null) ​

csharp
bool ValidateCode(string code, DateTime? timestamp = null, int allowedSkew = null)

Validates a TOTP code against the current time and optional skew.

Parameters ​

NameDescription
allowedSkewHow many time steps to check before/after current time.
codeThe user-submitted TOTP code.
timestampThe time to validate against (usually DateTime.UtcNow).

Returns ​

True if the code is valid within the allowed window; otherwise, false.