Add exception types for AndroidKeyStore key validity issues.

Bug: 18088752
Change-Id: I7494cb6a793e2b57bb849a4253bba2803778c161
This commit is contained in:
Alex Klyubin
2015-04-01 16:22:00 -07:00
parent 97467d82a3
commit 0b188927f4
4 changed files with 115 additions and 0 deletions

View File

@ -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: