UserKey

constructor(id: String, userId: String, userName: String, kid: String, authType: DeviceBindingAuthenticationType, createdAt: Long = System.currentTimeMillis())

Parameters

id

The unique identifier for this specific user key instance. This ID is used internally by the SDK to correlate key metadata with actual cryptographic keys stored in the Android KeyStore. Must be unique across all user keys on the device.

userId

The unique identifier of the user who owns this key. This corresponds to the user ID provided during device binding and is used to associate keys with specific user accounts. Multiple keys can exist for the same user with different authentication types.

userName

The human-readable username or email address associated with this key. This value is used for display purposes in user interfaces, such as key selection dialogs or account management screens. It provides users with recognizable information about key ownership.

kid

The key identifier used in JWT headers and cryptographic operations. This value is included in the "kid" (Key ID) field of JWT headers when signing tokens, allowing servers to identify which key was used for signature verification. Must be unique within the authentication context.

authType

The authentication method required to access this key's private key. Determines what type of user verification (biometric, PIN, none, etc.) must be completed before the key can be used for cryptographic operations. This value is set during device binding and cannot be changed afterward.

createdAt

The timestamp (in milliseconds since Unix epoch) when this key was created. Defaults to the current system time when the UserKey instance is created. Used for key lifecycle management, sorting, and auditing purposes. Can be used to identify the most recently created keys or implement key rotation policies.