Add remove method to RecoverableKeyStoreLoader.
Bug: 66499222 Test: GTS tests will be added. Change-Id: If352d75fbabe33e3453baed806f569931dbd8ad7
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user