[][src]Function motp::check_otp

pub fn check_otp(code: &str, secret: &str, pin: &str, valid_period: u8) -> bool

Verifies a give otp code according to shared secrets (secret & pin)

  • code: the user input
  • secret: the shared secret
  • pin: the pin, as supposedly inputed by the user on his client
  • valid_period: the length of validity of the token. token will be checked by this half this value in the past & future