SecretChallengeUtil<T> constructor

SecretChallengeUtil<T>({
  1. required Argon2HashUtil hashUtil,
  2. Argon2HashUtil? completionTokenHash,
  3. required SecretChallengeVerificationConfig<T> verificationConfig,
  4. required SecretChallengeCompletionConfig<T> completionConfig,
})

Creates a new SecretChallengeUtil instance.

verificationConfig is the configuration for verifying challenges. completionConfig is the configuration for completing challenges. hashUtil is the utility for hashing verification codes. completionTokenHash hashes completion tokens, which are long and random and suit Argon2HashUtil.forRandomSecrets. Defaults to hashUtil.

Implementation

SecretChallengeUtil({
  required final Argon2HashUtil hashUtil,
  final Argon2HashUtil? completionTokenHash,
  required final SecretChallengeVerificationConfig<T> verificationConfig,
  required final SecretChallengeCompletionConfig<T> completionConfig,
}) : _verificationConfig = verificationConfig,
     _completionConfig = completionConfig,
     _hashUtil = hashUtil,
     _completionTokenHash = completionTokenHash ?? hashUtil;