setAvailableAuthenticationKeys

open fun setAvailableAuthenticationKeys(keyCount: Int, maxUsesPerKey: Int, minValidTimeMillis: Long)

Sets the number of dynamic authentication keys the IdentityCredential will maintain, the number of times each should be used, and the minimum amount of time it's valid for.

The Identity Credential system will select the least-used dynamic authentication key each time getEntries is called. Identity Credentials for which this method has not been called behave as though it had been called wit keyCount 0, maxUsesPerKey 1, and minValidTimeMillis 0.

This is only implemented on FEATURE_VERSION_202301, fails with UnsupportedOperationException if using a store with a lesser version.

Parameters

keyCount

The number of active, certified dynamic authentication keys the IdentityCredential will try to keep available. This value must be non-negative.

maxUsesPerKey

The maximum number of times each of the keys will be used before it's eligible for replacement. This value must be greater than zero.

minValidTimeMillis

If a key has less time left than this value it will be eliglible for replacement.


abstract fun setAvailableAuthenticationKeys(keyCount: Int, maxUsesPerKey: Int)

Deprecated

Use setAvailableAuthenticationKeys instead.

Sets the number of dynamic authentication keys the IdentityCredential will maintain, and the number of times each should be used.

IdentityCredentials will select the least-used dynamic authentication key each time getEntries is called. IdentityCredentials for which this method has not been called behave as though it had been called wit keyCount 0 and maxUsesPerKey 1.

The effect of this method is like calling setAvailableAuthenticationKeys with the last parameter is set to 0.

Parameters

keyCount

The number of active, certified dynamic authentication keys the IdentityCredential will try to keep available. This value must be non-negative.

maxUsesPerKey

The maximum number of times each of the keys will be used before it's eligible for replacement. This value must be greater than zero.