Package org.keycloak.models
Class OTPPolicy
- java.lang.Object
-
- org.keycloak.models.OTPPolicy
-
- All Implemented Interfaces:
Serializable
public class OTPPolicy extends Object implements Serializable
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
algorithm
static boolean
DEFAULT_IS_REUSABLE
static OTPPolicy
DEFAULT_POLICY
protected int
digits
protected int
initialCounter
protected boolean
isCodeReusable
protected static org.jboss.logging.Logger
logger
protected int
lookAheadWindow
protected int
period
static String
REALM_REUSABLE_CODE_ATTRIBUTE
protected String
type
-
Constructor Summary
Constructors Constructor Description OTPPolicy()
OTPPolicy(String type, String algorithm, int initialCounter, int digits, int lookAheadWindow, int period)
OTPPolicy(String type, String algorithm, int initialCounter, int digits, int lookAheadWindow, int period, boolean isCodeReusable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlgorithm()
String
getAlgorithmKey()
int
getDigits()
int
getInitialCounter()
String
getKeyURI(RealmModel realm, UserModel user, String secret)
Constructs theotpauth://
URI based on the Key-Uri-Format.int
getLookAheadWindow()
int
getPeriod()
String
getType()
boolean
isCodeReusable()
void
setAlgorithm(String algorithm)
void
setCodeReusable(boolean isReusable)
void
setDigits(int digits)
void
setInitialCounter(int initialCounter)
void
setLookAheadWindow(int lookAheadWindow)
void
setPeriod(int period)
void
setType(String type)
-
-
-
Field Detail
-
logger
protected static final org.jboss.logging.Logger logger
-
type
protected String type
-
algorithm
protected String algorithm
-
initialCounter
protected int initialCounter
-
digits
protected int digits
-
lookAheadWindow
protected int lookAheadWindow
-
period
protected int period
-
isCodeReusable
protected boolean isCodeReusable
-
DEFAULT_POLICY
public static OTPPolicy DEFAULT_POLICY
-
DEFAULT_IS_REUSABLE
public static final boolean DEFAULT_IS_REUSABLE
- See Also:
- Constant Field Values
-
REALM_REUSABLE_CODE_ATTRIBUTE
public static final String REALM_REUSABLE_CODE_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAlgorithmKey
public String getAlgorithmKey()
-
getType
public String getType()
-
setType
public void setType(String type)
-
getAlgorithm
public String getAlgorithm()
-
setAlgorithm
public void setAlgorithm(String algorithm)
-
getInitialCounter
public int getInitialCounter()
-
setInitialCounter
public void setInitialCounter(int initialCounter)
-
getDigits
public int getDigits()
-
setDigits
public void setDigits(int digits)
-
getLookAheadWindow
public int getLookAheadWindow()
-
setLookAheadWindow
public void setLookAheadWindow(int lookAheadWindow)
-
getPeriod
public int getPeriod()
-
setPeriod
public void setPeriod(int period)
-
isCodeReusable
public boolean isCodeReusable()
-
setCodeReusable
public void setCodeReusable(boolean isReusable)
-
getKeyURI
public String getKeyURI(RealmModel realm, UserModel user, String secret)
Constructs theotpauth://
URI based on the Key-Uri-Format.- Parameters:
realm
-user
-secret
-- Returns:
- the
otpauth://
URI
-
-