summaryrefslogtreecommitdiffstats
path: root/core/java/android/security/keymaster
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-04-28 18:58:47 -0700
committerAlex Klyubin <klyubin@google.com>2015-04-29 12:44:10 -0700
commit708fc9404501ac42b6cac925fe3e10801b5f633b (patch)
tree7ac523612e9aac429bf1df2cd0a191551888fba3 /core/java/android/security/keymaster
parent47ea8b3d6bcef193a2d0ec9f0141525c83a0bcda (diff)
downloadframeworks_base-708fc9404501ac42b6cac925fe3e10801b5f633b.zip
frameworks_base-708fc9404501ac42b6cac925fe3e10801b5f633b.tar.gz
frameworks_base-708fc9404501ac42b6cac925fe3e10801b5f633b.tar.bz2
Add KeyPermanentlyInvalidatedException.
This enables users of AndroidKeyStore crypto to differentiate between the key being unusable until the user is authenticated (UserNotAuthenticatedException) and the key being permanently unusable (KeyPermanentlyInvalidatedException). The latter is the case when the secure lock screen has been disabled or reset, and, for keys that require user authentication for every use, when a new fingerprint is enrolled or all fingerprints are unenrolled. NOTE: The KeyPermanentlyInvalidatedException subsumes/replaces the NewFingerprintEnrolledException which has thus been removed. There is no way to find out whether a key was permenently invalidated specifically because a new fingerprint was added. Bug: 20642549 Bug: 20526234 Change-Id: I0206cd99eef5c605c9c4d6afc5eea02eb3b1fe6b
Diffstat (limited to 'core/java/android/security/keymaster')
-rw-r--r--core/java/android/security/keymaster/KeyCharacteristics.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/security/keymaster/KeyCharacteristics.java b/core/java/android/security/keymaster/KeyCharacteristics.java
index 458f153..03248e5 100644
--- a/core/java/android/security/keymaster/KeyCharacteristics.java
+++ b/core/java/android/security/keymaster/KeyCharacteristics.java
@@ -87,6 +87,28 @@ public class KeyCharacteristics implements Parcelable {
return result;
}
+ public Long getLong(int tag) {
+ if (hwEnforced.containsTag(tag)) {
+ return hwEnforced.getLong(tag, -1);
+ } else if (swEnforced.containsTag(tag)) {
+ return swEnforced.getLong(tag, -1);
+ } else {
+ return null;
+ }
+ }
+
+ public long getLong(int tag, long defaultValue) {
+ Long result = getLong(tag);
+ return (result != null) ? result : defaultValue;
+ }
+
+ public List<Long> getLongs(int tag) {
+ List<Long> result = new ArrayList<Long>();
+ result.addAll(hwEnforced.getLongs(tag));
+ result.addAll(swEnforced.getLongs(tag));
+ return result;
+ }
+
public Date getDate(int tag) {
Date result = hwEnforced.getDate(tag, null);
if (result == null) {