public abstract static class OathMechanism.OathBuilder<T extends OathMechanism.OathBuilder>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
accountName |
protected java.lang.String |
algorithm |
protected int |
digits |
protected java.lang.String |
issuer |
protected java.lang.String |
mechanismUID |
protected java.lang.String |
secret |
protected java.util.Calendar |
timeAdded |
| Constructor and Description |
|---|
OathBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected OathMechanism |
build()
Produce the described OathMechanism Token.
|
protected abstract T |
getThis() |
T |
setAccountName(java.lang.String accountName)
Sets the name of the account.
|
T |
setAlgorithm(java.lang.String algorithm)
Sets the algorithm used for generating the OTP.
|
T |
setDigits(int digits)
Sets the length of the OTP to generate.
|
T |
setIssuer(java.lang.String issuer)
Sets the name of the IDP that issued this account.
|
T |
setMechanismUID(java.lang.String mechanismUID)
Sets the mechanism unique Id.
|
T |
setSecret(java.lang.String secret)
Sets the secret used for generating the OTP.
|
T |
setTimeAdded(java.util.Calendar timeAdded)
Sets the Date and Time this mechanism was stored.
|
protected java.lang.String mechanismUID
protected java.lang.String issuer
protected java.lang.String accountName
protected java.lang.String algorithm
protected java.lang.String secret
protected int digits
protected java.util.Calendar timeAdded
protected abstract T getThis()
public T setMechanismUID(java.lang.String mechanismUID)
mechanismUID - the mechanism unique Idpublic T setIssuer(java.lang.String issuer)
issuer - The IDP namepublic T setAccountName(java.lang.String accountName)
accountName - The account namepublic T setAlgorithm(java.lang.String algorithm)
algorithm - algorithm to assignpublic T setSecret(java.lang.String secret)
secret - A Base32 encoded secret keypublic T setDigits(int digits)
digits - Number of digits, either 6 or 8public T setTimeAdded(java.util.Calendar timeAdded)
timeAdded - when this mechanism was stored.protected OathMechanism build() throws MechanismCreationException
MechanismCreationException - If an issuer or accountName were not provided.