diff options
author | Alex Klyubin <klyubin@google.com> | 2015-04-07 15:09:12 -0700 |
---|---|---|
committer | Alex Klyubin <klyubin@google.com> | 2015-04-07 15:09:12 -0700 |
commit | 38bb642bbb57131ef646c33ffc69ed07e4c957c5 (patch) | |
tree | d1df3e10c09db829278dbbc80ce4a4b76fc05914 /keystore/java | |
parent | 558184f52fa7822a0bde230a93e552f137ac91a4 (diff) | |
download | frameworks_base-38bb642bbb57131ef646c33ffc69ed07e4c957c5.zip frameworks_base-38bb642bbb57131ef646c33ffc69ed07e4c957c5.tar.gz frameworks_base-38bb642bbb57131ef646c33ffc69ed07e4c957c5.tar.bz2 |
Add BlockMode.GCM constant to AndroidKeyStore API.
GCM mode is not yet implemented. This is just adding a constant to
KeyStoreKeyConstraints.BlockMode.
Bug: 18088752
Change-Id: Ibba5b393f56ab9f6bb96d994f110687ab8d65ff3
Diffstat (limited to 'keystore/java')
-rw-r--r-- | keystore/java/android/security/KeyStoreKeyConstraints.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/keystore/java/android/security/KeyStoreKeyConstraints.java b/keystore/java/android/security/KeyStoreKeyConstraints.java index bd7aacf..0297323 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); } |