Generating StrongBox backed keys

•Add FLAG_STRONGBOX when the generator spec requires it.
•Throw StrongBoxUnavailableException when the request
fails due to HARDWARE_UNAVAILABLE.
•Add PackageManager.FEATURE_STRONGBOX_KEYSTORE

Test: KeyStore CTS tests under development on an emulator
Bug: 63931634
Change-Id: I42d32b22981e43e504d30e5657d21ac555c71ebe
This commit is contained in:
Frank Salim
2018-01-23 22:42:29 -08:00
parent f88fdc995f
commit ea5e038bc1
5 changed files with 34 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ import android.security.keymaster.OperationResult;
import android.security.keystore.KeyExpiredException;
import android.security.keystore.KeyNotYetValidException;
import android.security.keystore.KeyPermanentlyInvalidatedException;
import android.security.keystore.StrongBoxUnavailableException;
import android.security.keystore.UserNotAuthenticatedException;
import android.util.Log;
@@ -65,6 +66,7 @@ public class KeyStore {
public static final int VALUE_CORRUPTED = 8;
public static final int UNDEFINED_ACTION = 9;
public static final int WRONG_PASSWORD = 10;
public static final int HARDWARE_TYPE_UNAVAILABLE = -68;
/**
* Per operation authentication is needed before this operation is valid.
@@ -123,7 +125,6 @@ public class KeyStore {
*/
public static final int FLAG_STRONGBOX = 1 << 4;
// States
public enum State { UNLOCKED, LOCKED, UNINITIALIZED };