DefaultDeviceIdentifier

The default implementation of DeviceIdentifier that uses the Android KeyStore to generate a persistent device identifier.

This implementation:

  • Creates an RSA key pair in the Android KeyStore the first time it's accessed

  • Uses the public key as the basis for a device identifier

  • Applies SHA-256 hashing to the key data and converts it to a hex string

  • Caches the identifier for efficient subsequent access

Note: The identifier will change if the device is factory reset or if the key is explicitly removed from the KeyStore.

Properties

Link copied to clipboard
open override val id: suspend () -> String

A lazily initialized device identifier string. The value is computed once on first access and cached for subsequent calls.