public interface DcvOathDevice
Modifier and Type | Method and Description |
---|---|
SecureString |
getDcv(AuthInput authInput)
Gets a time based DCV value as defined by the Standard Gemalto DCV
options.
|
int |
getLastDcvLifespan()
Return lifespan of the last DCV computed by this device.
|
SecureString getDcv(AuthInput authInput) throws IdpException
authInput
- the AuthInputIdpRuntimeException
- when there is a cryptography operation failure.IdpException
- this is generic exception, you can directly catch this
exception or catch each specific exception below.IdpStorageException
- when there is a database operation failure.DeviceFingerprintException
- when the token's fingerprint checksum does not match.PasswordManagerException
- when the TOKEN domain is not logged in (using one of the
password managers).int getLastDcvLifespan()
The following example illustrates the usage:
// Create DCV OATH settings (see OathFactory) SoftDcvOathSettings dcvOathSettings = ... // Create a DCV OATH device (see OathFactory) OathDcvDevice device = ... // Compute a time-based DCV with device device.getDcv(pin); // Each time getLastDcvLifespan is called, it returns the // remaining lifespan in seconds of the last time-based DCV. Lifespan is // computed with respect of device's settings (in this example it returns // the lifespan according to Gemalto device fixed settings, i.e. 30-seconds timestep). int lifespan = device.getLastDcvLifespan();