| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_PASSWORD_LENGTH
默认密码长度.
|
static HmacAlgorithm |
HOTP_HMAC_ALGORITHM
默认HMAC算法.
|
| 构造器和说明 |
|---|
HOTP(byte[] key)
构造,使用默认密码长度和默认HMAC算法(HmacSHA1)
|
HOTP(int passwordLength,
byte[] key)
构造,使用默认HMAC算法(HmacSHA1)
|
HOTP(int passwordLength,
HmacAlgorithm algorithm,
byte[] key)
构造
|
public static final int DEFAULT_PASSWORD_LENGTH
public static final HmacAlgorithm HOTP_HMAC_ALGORITHM
public HOTP(byte[] key)
key - 共享密码,RFC 4226要求最少128位public HOTP(int passwordLength,
byte[] key)
passwordLength - 密码长度,可以是6,7,8key - 共享密码,RFC 4226要求最少128位public HOTP(int passwordLength,
HmacAlgorithm algorithm,
byte[] key)
passwordLength - 密码长度,可以是6,7,8algorithm - HMAC算法枚举key - 共享密码,RFC 4226要求最少128位public int generate(long counter)
counter - 事件计数的值,8 字节的整数,称为移动因子(moving factor),
可以是基于计次的动移动因子,也可以是计时移动因子public int getPasswordLength()
public String getAlgorithm()
Copyright © 2020. All rights reserved.