我正在尝试从我的 YubiKey 5 NFC 获取当前的 OATH TOTP 代码:
Code otpCode = oathSession.CalculateCredential(myCredential);
不知何故,返回的值与 Yubico Authenticator 应用程序中显示的当前值不同。
using (var oathSession = new OathSession(_yubiKeyToUse))
{
var myCredential = new Credential
{
Issuer = "ACME Inc.",
AccountName = "Software Development",
Type = CredentialType.Totp,
Period = CredentialPeriod.Period30,
Digits = 6,
Secret = "HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ",
RequiresTouch = false,
Algorithm = HashAlgorithm.Sha1
};
oathSession.AddCredential(myCredential);
}
什么解释了 TOTP 代码之间的区别?