Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac3dbf48 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add remove method to RecoverableKeyStoreLoader."

parents 7a2c9d98 e77a24b8
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -478,10 +478,12 @@ public class RecoverableKeyStoreLoader {
     * Generates a key called {@code alias} and loads it into the recoverable key store. Returns the
     * raw material of the key.
     *
     * @param alias The key alias.
     * @throws RecoverableKeyStoreLoaderException if an error occurred generating and storing the
     *     key.
     */
    public byte[] generateAndStoreKey(String alias) throws RecoverableKeyStoreLoaderException {
    public byte[] generateAndStoreKey(@NonNull String alias)
            throws RecoverableKeyStoreLoaderException {
        try {
            return mBinder.generateAndStoreKey(alias);
        } catch (RemoteException e) {
@@ -490,4 +492,19 @@ public class RecoverableKeyStoreLoader {
            throw RecoverableKeyStoreLoaderException.fromServiceSpecificException(e);
        }
    }

    /**
     * Removes a key called {@code alias} from the recoverable key store.
     *
     * @param alias The key alias.
     */
    public void removeKey(@NonNull String alias) throws RecoverableKeyStoreLoaderException {
        try {
            mBinder.removeKey(alias);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        } catch (ServiceSpecificException e) {
            throw RecoverableKeyStoreLoaderException.fromServiceSpecificException(e);
        }
    }
}