summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-03-30 20:33:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-30 20:33:55 +0000
commit021a1e090a98d6a8cbf05ec1a0d3f899a7b4598a (patch)
tree7ae49ef4aeee36fded5e75d6a75249d7e857cfeb /keystore
parentb730035761c68ad82f6308f32f884cd4b7b8e1ca (diff)
parent7081a16859cdcf32f565379a8179ddc7b50b3c1d (diff)
downloadframeworks_base-021a1e090a98d6a8cbf05ec1a0d3f899a7b4598a.zip
frameworks_base-021a1e090a98d6a8cbf05ec1a0d3f899a7b4598a.tar.gz
frameworks_base-021a1e090a98d6a8cbf05ec1a0d3f899a7b4598a.tar.bz2
am 7081a168: am 5341d83c: am f603e286: Merge "Add authorization binder methods"
* commit '7081a16859cdcf32f565379a8179ddc7b50b3c1d': Add authorization binder methods
Diffstat (limited to 'keystore')
-rw-r--r--keystore/java/android/security/KeyStore.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index f68b3f6..94a479b 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -476,4 +476,34 @@ public class KeyStore {
return SYSTEM_ERROR;
}
}
+
+ /**
+ * Check if the operation referenced by {@code token} is currently authorized.
+ *
+ * @param token An operation token returned by a call to {@link KeyStore.begin}.
+ */
+ public boolean isOperationAuthorized(IBinder token) {
+ try {
+ return mBinder.isOperationAuthorized(token);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Cannot connect to keystore", e);
+ return false;
+ }
+ }
+
+ /**
+ * Add an authentication record to the keystore authorization table.
+ *
+ * @param authToken The packed bytes of a hw_auth_token_t to be provided to keymaster.
+ * @return {@code KeyStore.NO_ERROR} on success, otherwise an error value corresponding to
+ * a {@code KeymasterDefs.KM_ERROR_} value or {@code KeyStore} ResponseCode.
+ */
+ public int addAuthToken(byte[] authToken) {
+ try {
+ return mBinder.addAuthToken(authToken);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Cannot connect to keystore", e);
+ return SYSTEM_ERROR;
+ }
+ }
}