diff options
author | Alex Klyubin <klyubin@google.com> | 2015-04-09 19:57:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-09 19:57:13 +0000 |
commit | 8c58ba87bb82993b2bd5dbdd948d15fe3297d08e (patch) | |
tree | 4f89be19057e67687ecc29ba474b9ebb291a16cb /keystore/java | |
parent | d9f32b164be11b6c42ee36ca6945623073e82c99 (diff) | |
parent | 5324702a02660d75a9dfb231daeb0c3ede75c499 (diff) | |
download | frameworks_base-8c58ba87bb82993b2bd5dbdd948d15fe3297d08e.zip frameworks_base-8c58ba87bb82993b2bd5dbdd948d15fe3297d08e.tar.gz frameworks_base-8c58ba87bb82993b2bd5dbdd948d15fe3297d08e.tar.bz2 |
Merge "Add missing mapping between JCA and keystore HMAC names."
Diffstat (limited to 'keystore/java')
-rw-r--r-- | keystore/java/android/security/AndroidKeyStoreProvider.java | 1 | ||||
-rw-r--r-- | keystore/java/android/security/KeyStoreKeyConstraints.java | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/keystore/java/android/security/AndroidKeyStoreProvider.java b/keystore/java/android/security/AndroidKeyStoreProvider.java index 635b2fa..43f3b30 100644 --- a/keystore/java/android/security/AndroidKeyStoreProvider.java +++ b/keystore/java/android/security/AndroidKeyStoreProvider.java @@ -64,6 +64,7 @@ public class AndroidKeyStoreProvider extends Provider { putSecretKeyFactoryImpl("HmacSHA512"); // javax.crypto.Mac + putMacImpl("HmacSHA1", PACKAGE_NAME + ".KeyStoreHmacSpi$HmacSHA1"); putMacImpl("HmacSHA224", PACKAGE_NAME + ".KeyStoreHmacSpi$HmacSHA224"); putMacImpl("HmacSHA256", PACKAGE_NAME + ".KeyStoreHmacSpi$HmacSHA256"); putMacImpl("HmacSHA384", PACKAGE_NAME + ".KeyStoreHmacSpi$HmacSHA384"); diff --git a/keystore/java/android/security/KeyStoreKeyConstraints.java b/keystore/java/android/security/KeyStoreKeyConstraints.java index 7f691fb..02108fd 100644 --- a/keystore/java/android/security/KeyStoreKeyConstraints.java +++ b/keystore/java/android/security/KeyStoreKeyConstraints.java @@ -213,8 +213,18 @@ public abstract class KeyStoreKeyConstraints { throw new IllegalArgumentException("HMAC digest not specified"); } switch (digest) { + case Digest.MD5: + return "HmacMD5"; + case Digest.SHA1: + return "HmacSHA1"; + case Digest.SHA224: + return "HmacSHA224"; case Digest.SHA256: return "HmacSHA256"; + case Digest.SHA384: + return "HmacSHA384"; + case Digest.SHA512: + return "HmacSHA512"; default: throw new IllegalArgumentException( "Unsupported HMAC digest: " + digest); |