summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-04-08 22:12:38 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-08 22:12:38 +0000
commitbd877f261bfd0cc4b15138e9d6f88ef8337031bc (patch)
tree3b717498d97b1f0c251065f23d34635d3194b92f /keystore
parent49208d0b9125f78883ad92fc8d4bdc929bdb9403 (diff)
parent8ad875f52de3ffa99fea22177e26a7f22c3735b1 (diff)
downloadframeworks_base-bd877f261bfd0cc4b15138e9d6f88ef8337031bc.zip
frameworks_base-bd877f261bfd0cc4b15138e9d6f88ef8337031bc.tar.gz
frameworks_base-bd877f261bfd0cc4b15138e9d6f88ef8337031bc.tar.bz2
am 8ad875f5: am 0649c832: am 3283d2d2: Merge "Add BlockMode.GCM constant to AndroidKeyStore API."
* commit '8ad875f52de3ffa99fea22177e26a7f22c3735b1': Add BlockMode.GCM constant to AndroidKeyStore API.
Diffstat (limited to 'keystore')
-rw-r--r--keystore/java/android/security/KeyStoreKeyConstraints.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/keystore/java/android/security/KeyStoreKeyConstraints.java b/keystore/java/android/security/KeyStoreKeyConstraints.java
index 7137a9a..2da548d 100644
--- a/keystore/java/android/security/KeyStoreKeyConstraints.java
+++ b/keystore/java/android/security/KeyStoreKeyConstraints.java
@@ -471,7 +471,7 @@ public abstract class KeyStoreKeyConstraints {
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true,
- value = {BlockMode.ECB, BlockMode.CBC, BlockMode.CTR})
+ value = {BlockMode.ECB, BlockMode.CBC, BlockMode.CTR, BlockMode.GCM})
public @interface BlockModeEnum {}
/**
@@ -489,6 +489,9 @@ public abstract class KeyStoreKeyConstraints {
/** Counter (CTR) block mode. */
public static final int CTR = 1 << 2;
+ /** Galois/Counter Mode (GCM) block mode. */
+ public static final int GCM = 1 << 3;
+
/**
* @hide
*/
@@ -500,6 +503,8 @@ public abstract class KeyStoreKeyConstraints {
return KeymasterDefs.KM_MODE_CBC;
case CTR:
return KeymasterDefs.KM_MODE_CTR;
+ case GCM:
+ return KeymasterDefs.KM_MODE_GCM;
default:
throw new IllegalArgumentException("Unknown block mode: " + mode);
}
@@ -516,6 +521,8 @@ public abstract class KeyStoreKeyConstraints {
return CBC;
case KeymasterDefs.KM_MODE_CTR:
return CTR;
+ case KeymasterDefs.KM_MODE_GCM:
+ return GCM;
default:
throw new IllegalArgumentException("Unknown block mode: " + mode);
}
@@ -554,6 +561,8 @@ public abstract class KeyStoreKeyConstraints {
return "CBC";
case CTR:
return "CTR";
+ case GCM:
+ return "GCM";
default:
throw new IllegalArgumentException("Unknown block mode: " + mode);
}
@@ -570,6 +579,8 @@ public abstract class KeyStoreKeyConstraints {
return CBC;
} else if ("ctr".equals(modeLower)) {
return CTR;
+ } else if ("gcm".equals(modeLower)) {
+ return CTR;
} else {
throw new IllegalArgumentException("Unknown block mode: " + mode);
}