summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeymasterUtils.java
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-04-01 16:22:00 -0700
committerAlex Klyubin <klyubin@google.com>2015-04-01 16:22:00 -0700
commit0b188927f45f0794560d5c29123abbd75ddc0851 (patch)
treede3e96487bf8a77f6f0b54b0596112222be62a4b /keystore/java/android/security/KeymasterUtils.java
parent97467d82a31964e36cb6bc32ac4cf00e884c190e (diff)
Add exception types for AndroidKeyStore key validity issues.
Bug: 18088752 Change-Id: I7494cb6a793e2b57bb849a4253bba2803778c161
Diffstat (limited to 'keystore/java/android/security/KeymasterUtils.java')
-rw-r--r--keystore/java/android/security/KeymasterUtils.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/keystore/java/android/security/KeymasterUtils.java b/keystore/java/android/security/KeymasterUtils.java
index 2645cf436363..c426a34bb5e7 100644
--- a/keystore/java/android/security/KeymasterUtils.java
+++ b/keystore/java/android/security/KeymasterUtils.java
@@ -44,6 +44,10 @@ public abstract class KeymasterUtils {
public static CryptoOperationException getCryptoOperationException(KeymasterException e) {
switch (e.getErrorCode()) {
+ case KeymasterDefs.KM_ERROR_KEY_EXPIRED:
+ return new KeyExpiredException();
+ case KeymasterDefs.KM_ERROR_KEY_NOT_YET_VALID:
+ return new KeyNotYetValidException();
case KeymasterDefs.KM_ERROR_KEY_USER_NOT_AUTHENTICATED:
return new UserNotAuthenticatedException();
default: