public class DeviceIdentifier
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DeviceIdentifier.DeviceIdentifierBuilder |
| Constructor and Description |
|---|
DeviceIdentifier(android.content.Context context,
KeyStoreManager keyStoreManager) |
| Modifier and Type | Method and Description |
|---|---|
static DeviceIdentifier.DeviceIdentifierBuilder |
builder() |
java.security.cert.Certificate |
getCertificate()
Retrieve the certificate that used to generate the device ID.
|
java.lang.String |
getIdentifier()
Retrieve the Device Identifier, the device identifier is stable except when:
|
void |
persist(byte[] certificate)
Persist the X509 certificate to the KeyStore, the certificate will be used to generate the
Device Key Identifier
|
public DeviceIdentifier(android.content.Context context,
KeyStoreManager keyStoreManager)
context - keyStoreManager - public java.lang.String getIdentifier()
* App is restored on a new device
* User uninstalls/reinstall the App
* User clears app data.
public java.security.cert.Certificate getCertificate()
throws java.security.GeneralSecurityException,
java.io.IOException
java.security.GeneralSecurityException - General Security Exception when access the KeyStorejava.io.IOException - IOException when access the KeyStorepublic void persist(byte[] certificate)
throws java.security.GeneralSecurityException,
java.io.IOException
certificate - the certificate that used to generate the device identifier.java.security.GeneralSecurityException - General Security Exception when access the KeyStorejava.io.IOException - IOException when access the KeyStorepublic static DeviceIdentifier.DeviceIdentifierBuilder builder()