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 and Description
    --- | ---
    `protected String` | `algorithm`
    `static OTPPolicy` | `DEFAULT_POLICY`
    `protected int` | `digits`
    `protected int` | `initialCounter`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected int` | `lookAheadWindow`
    `protected int` | `period`
    `protected String` | `type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OTPPolicy()`
    `OTPPolicy(String type, String algorithm, int initialCounter, int digits, int lookAheadWindow, int period)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getAlgorithm()`
    `int` | `getDigits()`
    `int` | `getInitialCounter()`
    `String` | `getKeyURI(RealmModel realm, UserModel user, String secret)` Constructs the `otpauth://` URI based on the Key-Uri-Format.
    `int` | `getLookAheadWindow()`
    `int` | `getPeriod()`
    `String` | `getType()`
    `void` | `setAlgorithm(String algorithm)`
    `void` | `setDigits(int digits)`
    `void` | `setInitialCounter(int initialCounter)`
    `void` | `setLookAheadWindow(int lookAheadWindow)`
    `void` | `setPeriod(int period)`
    `void` | `setType(String type)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

    - #### DEFAULT_POLICY

          public static OTPPolicy DEFAULT_POLICY

  - ### Constructor Detail

    - #### OTPPolicy

          public OTPPolicy()

    - #### OTPPolicy

          public OTPPolicy(String type,
                           String algorithm,
                           int initialCounter,
                           int digits,
                           int lookAheadWindow,
                           int period)

  - ### Method Detail

    - #### 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)

    - #### getKeyURI

          public String getKeyURI(RealmModel realm,
                                  UserModel user,
                                  String secret)

      Constructs the `otpauth://` URI based on the Key-Uri-Format.
      Parameters:
        `realm` -
        `user` -
        `secret` -
      Returns:
        the `otpauth://` URI

Copyright © 2016 JBoss by Red Hat. All rights reserved.