Package org.keycloak.models.credential
Class OTPCredentialModel
java.lang.Object
org.keycloak.credential.CredentialModel
org.keycloak.models.credential.OTPCredentialModel
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The supported encodings when reading the raw secret from the storage -
Field Summary
Fields inherited from class org.keycloak.credential.CredentialModel
CLIENT_CERT, KERBEROS, OTP, PASSWORD, PASSWORD_HISTORY, PASSWORD_TOKEN, SECRET
-
Method Summary
Modifier and TypeMethodDescriptionstatic OTPCredentialModel
createFromCredentialModel
(CredentialModel credentialModel) static OTPCredentialModel
createFromPolicy
(RealmModel realm, String secretValue) static OTPCredentialModel
createFromPolicy
(RealmModel realm, String secretValue, String userLabel) static OTPCredentialModel
createHOTP
(String secretValue, int digits, int counter, String algorithm) static OTPCredentialModel
createTOTP
(String secretValue, int digits, int period, String algorithm) static OTPCredentialModel
createTOTP
(String secretValue, int digits, int period, String algorithm, String encoding) byte[]
void
updateCounter
(int counter) Methods inherited from class org.keycloak.credential.CredentialModel
comparingByStartDateDesc, getAlgorithm, getConfig, getCounter, getCreatedDate, getCredentialData, getDevice, getDigits, getHashIterations, getId, getPeriod, getSalt, getSecretData, getType, getUserLabel, getValue, setAlgorithm, setConfig, setCounter, setCreatedDate, setCredentialData, setDevice, setDigits, setHashIterations, setId, setPeriod, setSalt, setSecretData, setType, setUserLabel, setValue, shallowClone
-
Field Details
-
TYPE
- See Also:
-
TOTP
- See Also:
-
HOTP
- See Also:
-
-
Method Details
-
createTOTP
public static OTPCredentialModel createTOTP(String secretValue, int digits, int period, String algorithm) -
createTOTP
public static OTPCredentialModel createTOTP(String secretValue, int digits, int period, String algorithm, String encoding) -
createHOTP
public static OTPCredentialModel createHOTP(String secretValue, int digits, int counter, String algorithm) -
createFromPolicy
-
createFromPolicy
public static OTPCredentialModel createFromPolicy(RealmModel realm, String secretValue, String userLabel) -
createFromCredentialModel
-
updateCounter
public void updateCounter(int counter) -
getOTPCredentialData
-
getOTPSecretData
-
getDecodedSecret
public byte[] getDecodedSecret()
-