Package org.forgerock.android.auth
Class DeviceIdentifier
- java.lang.Object
-
- org.forgerock.android.auth.DeviceIdentifier
-
public class DeviceIdentifier extends java.lang.ObjectModel of Device Identifier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeviceIdentifier.DeviceIdentifierBuilderBuilder class to build the device identifier
-
Constructor Summary
Constructors Constructor Description DeviceIdentifier(android.content.Context context, org.forgerock.android.auth.KeyStoreManager keyStoreManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DeviceIdentifier.DeviceIdentifierBuilderbuilder()Initiate the DeviceIdentifierBuilder classjava.security.cert.CertificategetCertificate()Retrieve the certificate that used to generate the device ID.java.lang.StringgetIdentifier()Retrieve the Device Identifier, the device identifier is stable except when:voidpersist(byte[] certificate)Persist the X509 certificate to the KeyStore, the certificate will be used to generate the Device Key Identifier
-
-
-
Method Detail
-
builder
public static DeviceIdentifier.DeviceIdentifierBuilder builder()
Initiate the DeviceIdentifierBuilder class
-
getIdentifier
public java.lang.String getIdentifier()
Retrieve the Device Identifier, the device identifier is stable except when:* App is restored on a new device
* User uninstalls/reinstall the App
* User clears app data.
- Returns:
- The Device Identifier.
-
getCertificate
@Nullable public java.security.cert.Certificate getCertificate() throws java.security.GeneralSecurityException, java.io.IOExceptionRetrieve the certificate that used to generate the device ID. The Certificate is stored in the Android KeyStore- Returns:
- the certificate, or null if the given alias does not exist or does not contain a certificate.
- Throws:
java.security.GeneralSecurityException- General Security Exception when access the KeyStorejava.io.IOException- IOException when access the KeyStore
-
persist
public void persist(byte[] certificate) throws java.security.GeneralSecurityException, java.io.IOExceptionPersist the X509 certificate to the KeyStore, the certificate will be used to generate the Device Key Identifier- Parameters:
certificate- the certificate that used to generate the device identifier.- Throws:
java.security.GeneralSecurityException- General Security Exception when access the KeyStorejava.io.IOException- IOException when access the KeyStore
-
-