Loading keystore/java/android/security/AndroidKeyStoreMaintenance.java +25 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.security; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.os.StrictMode; Loading Loading @@ -218,4 +219,28 @@ public class AndroidKeyStoreMaintenance { return SYSTEM_ERROR; } } /** * Returns the list of Application UIDs that have auth-bound keys that are bound to * the given SID. This enables warning the user when they are about to invalidate * a SID (for example, removing the LSKF). * * @param userId - The ID of the user the SID is associated with. * @param userSecureId - The SID in question. * * @return A list of app UIDs. */ public static long[] getAllAppUidsAffectedBySid(int userId, long userSecureId) throws KeyStoreException { StrictMode.noteDiskWrite(); try { return getService().getAppUidsAffectedBySid(userId, userSecureId); } catch (RemoteException | NullPointerException e) { throw new KeyStoreException(SYSTEM_ERROR, "Failure to connect to Keystore while trying to get apps affected by SID."); } catch (ServiceSpecificException e) { throw new KeyStoreException(e.errorCode, "Keystore error while trying to get apps affected by SID."); } } } Loading
keystore/java/android/security/AndroidKeyStoreMaintenance.java +25 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.security; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.os.StrictMode; Loading Loading @@ -218,4 +219,28 @@ public class AndroidKeyStoreMaintenance { return SYSTEM_ERROR; } } /** * Returns the list of Application UIDs that have auth-bound keys that are bound to * the given SID. This enables warning the user when they are about to invalidate * a SID (for example, removing the LSKF). * * @param userId - The ID of the user the SID is associated with. * @param userSecureId - The SID in question. * * @return A list of app UIDs. */ public static long[] getAllAppUidsAffectedBySid(int userId, long userSecureId) throws KeyStoreException { StrictMode.noteDiskWrite(); try { return getService().getAppUidsAffectedBySid(userId, userSecureId); } catch (RemoteException | NullPointerException e) { throw new KeyStoreException(SYSTEM_ERROR, "Failure to connect to Keystore while trying to get apps affected by SID."); } catch (ServiceSpecificException e) { throw new KeyStoreException(e.errorCode, "Keystore error while trying to get apps affected by SID."); } } }