Loading keystore/java/android/security/AndroidKeyStoreMaintenance.java +22 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.security.usermanager.IKeystoreUserManager; import android.system.keystore2.Domain; import android.system.keystore2.ResponseCode; import android.util.Log; Loading @@ -39,7 +40,7 @@ public class AndroidKeyStoreMaintenance { } /** * Informs keystore2 about adding a user * Informs Keystore 2.0 about adding a user * * @param userId - Android user id of the user being added * @return 0 if successful or a {@code ResponseCode} Loading @@ -60,7 +61,7 @@ public class AndroidKeyStoreMaintenance { } /** * Informs keystore2 about removing a usergit mer * Informs Keystore 2.0 about removing a usergit mer * * @param userId - Android user id of the user being removed * @return 0 if successful or a {@code ResponseCode} Loading @@ -81,7 +82,7 @@ public class AndroidKeyStoreMaintenance { } /** * Informs keystore2 about changing user's password * Informs Keystore 2.0 about changing user's password * * @param userId - Android user id of the user * @param password - a secret derived from the synthetic password provided by the Loading @@ -102,4 +103,22 @@ public class AndroidKeyStoreMaintenance { return SYSTEM_ERROR; } } /** * Informs Keystore 2.0 that an app was uninstalled and the corresponding namspace is to * be cleared. */ public static int clearNamespace(@Domain int domain, long namespace) { if (!android.security.keystore2.AndroidKeyStoreProvider.isInstalled()) return 0; try { getService().clearNamespace(domain, namespace); return 0; } catch (ServiceSpecificException e) { Log.e(TAG, "clearNamespace failed", e); return e.errorCode; } catch (Exception e) { Log.e(TAG, "Can not connect to keystore", e); return SYSTEM_ERROR; } } } keystore/java/android/security/KeyStore.java +4 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import android.security.keystore.KeyPermanentlyInvalidatedException; import android.security.keystore.KeyProperties; import android.security.keystore.KeystoreResponse; import android.security.keystore.UserNotAuthenticatedException; import android.system.keystore2.Domain; import android.util.Log; import com.android.internal.org.bouncycastle.asn1.ASN1InputStream; Loading Loading @@ -466,6 +467,9 @@ public class KeyStore { public boolean clearUid(int uid) { try { if (android.security.keystore2.AndroidKeyStoreProvider.isInstalled()) { return AndroidKeyStoreMaintenance.clearNamespace(Domain.APP, uid) == 0; } return mBinder.clear_uid(uid) == NO_ERROR; } catch (RemoteException e) { Log.w(TAG, "Cannot connect to keystore", e); Loading Loading
keystore/java/android/security/AndroidKeyStoreMaintenance.java +22 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.security.usermanager.IKeystoreUserManager; import android.system.keystore2.Domain; import android.system.keystore2.ResponseCode; import android.util.Log; Loading @@ -39,7 +40,7 @@ public class AndroidKeyStoreMaintenance { } /** * Informs keystore2 about adding a user * Informs Keystore 2.0 about adding a user * * @param userId - Android user id of the user being added * @return 0 if successful or a {@code ResponseCode} Loading @@ -60,7 +61,7 @@ public class AndroidKeyStoreMaintenance { } /** * Informs keystore2 about removing a usergit mer * Informs Keystore 2.0 about removing a usergit mer * * @param userId - Android user id of the user being removed * @return 0 if successful or a {@code ResponseCode} Loading @@ -81,7 +82,7 @@ public class AndroidKeyStoreMaintenance { } /** * Informs keystore2 about changing user's password * Informs Keystore 2.0 about changing user's password * * @param userId - Android user id of the user * @param password - a secret derived from the synthetic password provided by the Loading @@ -102,4 +103,22 @@ public class AndroidKeyStoreMaintenance { return SYSTEM_ERROR; } } /** * Informs Keystore 2.0 that an app was uninstalled and the corresponding namspace is to * be cleared. */ public static int clearNamespace(@Domain int domain, long namespace) { if (!android.security.keystore2.AndroidKeyStoreProvider.isInstalled()) return 0; try { getService().clearNamespace(domain, namespace); return 0; } catch (ServiceSpecificException e) { Log.e(TAG, "clearNamespace failed", e); return e.errorCode; } catch (Exception e) { Log.e(TAG, "Can not connect to keystore", e); return SYSTEM_ERROR; } } }
keystore/java/android/security/KeyStore.java +4 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import android.security.keystore.KeyPermanentlyInvalidatedException; import android.security.keystore.KeyProperties; import android.security.keystore.KeystoreResponse; import android.security.keystore.UserNotAuthenticatedException; import android.system.keystore2.Domain; import android.util.Log; import com.android.internal.org.bouncycastle.asn1.ASN1InputStream; Loading Loading @@ -466,6 +467,9 @@ public class KeyStore { public boolean clearUid(int uid) { try { if (android.security.keystore2.AndroidKeyStoreProvider.isInstalled()) { return AndroidKeyStoreMaintenance.clearNamespace(Domain.APP, uid) == 0; } return mBinder.clear_uid(uid) == NO_ERROR; } catch (RemoteException e) { Log.w(TAG, "Cannot connect to keystore", e); Loading