164 Commits

Author SHA1 Message Date
Alex Klyubin
590c068e83 Merge "Add KeyPairGenerator.EC backed by Android KeyStore." 2015-01-16 16:44:06 +00:00
Alex Klyubin
21a76df55c Add KeyPairGenerator.EC backed by Android KeyStore.
The Android KeyStore backed KeyPairGenerator can generate EC key
pairs, but it cannot be instantiated via the standard JCA approach of
KeyPairGenerator.getInstance("EC", "AndroidKeyStore"). Instead, the
user must invoke KeyPairGenerator.getInstance("RSA",
"AndroidKeyStore") and then tell it to generate an EC key pair.

This CL fixes this weirdness.

The fix requires the introduction of late resolution of key algorithm
and default key size. Prior to this CL, these parameters were resolved
prior to KeyPairGenerator initialization, inside KeyPairGeneratorSpec.
In this CL, these parameters are resolved during KeyPairGenerator
initialization. This is fine because KeyPairGeneratorSpec should be as
dumb as possible and all the logic should reside in KeyPairGenerator
and lower layers.

Bug: 19018089
Change-Id: I114502356e6c9691518cf05b6d9eb0920b4fe0b2
2015-01-14 13:35:32 -08:00
Chad Brubaker
7a2c973db7 Generate IKeystoreService using aidl
This replaces IKeystoreService.java with IKeystoreService.aidl and
changes the methods that passed down a byte[][] to instead pass down a
KeystoreArguments which is currently a thin parcelable wrapper around a byte[][].

Change-Id: I6367bcf57562f41a27aab14f1903b74995cb65c2
2015-01-13 18:29:15 -08:00
Kenny Root
9d2d6b6b4b Track change to Conscrypt
Change-Id: I8814fd0720acf09332927f184fdd9b2cdac4f413
2014-11-26 09:08:40 -08:00
Shawn Willden
dc8bc1160c Correct test data size in keystore signing and verification tests.
The test is sending too much data to be signed, which should actually
fail, and does on Volantis.  Apparently the other keymaster implementors
do something to pass it, because shamu and hammerhead pass, but the test
is wrong.

Change-Id: Ic616a551567d64f5d87d9607ceb08afa7be74f9d
2014-09-14 17:09:47 +00:00
Bernhard Bauer
26408ccd8e Add DevicePolicyManager PrivateKey mgmt
Additional device policy API to install keypairs to the keychain
silently.

Bug: 15065444
Change-Id: Idc25774c9ab1a61080290bebd6f5c4f24e6ee2e0
2014-09-11 19:17:00 +01:00
Zoltan Szatmary-Ban
f0ae135049 Extend IKeyChainService AIDL with CACert retrieval
Bug:16029580
Change-Id: I41a3bd2f3bd95550e59f1d0d0acd0e765d7b62d7
2014-09-08 17:59:42 +01:00
Robin Lee
f0246a8a14 Keep managed profile keystores in sync with owner
Fixes setting a keyguard password for keystore in a multi-user setup
while we're at it.

Bug: 16233206.
Change-Id: I7941707ca66ac25bd122fd22e5e0f639e7af697e
2014-08-29 23:03:42 +01:00
Zoltan Szatmary-Ban
3291de8f6c Revert "Revert "Revert "Revert "Revert "Update Trusted Credentials screen in settings"""""
This reverts commit c9249c69813c6fb889d71d84583c67ae2942e6de.

Change-Id: I5504fddaf7b18efb73cd6c76678b3b39ce9b0229
2014-08-15 14:01:14 +00:00
Zoltan Szatmary-Ban
f8d72cc14f Revert "Revert "Revert "Revert "Update Trusted Credentials screen in settings""""
This reverts commit 87efe74e092236c372d3b6909009641123aa416a.

This should be fine now with all the dependency CLs +2-ed


Change-Id: I96ad14ad5ff81e6b5391035cb6c5a62339c6cc40
2014-08-15 12:58:37 +00:00
Narayan Kamath
f75aadc028 Revert "Revert "Revert "Update Trusted Credentials screen in settings"""
This reverts commit 19c8ce291e89a9ef1442a20e1feab421b11536d7.

Change-Id: Ie5a5571127311e0a29f314c0566e779cfe940b53
2014-08-15 12:25:52 +00:00
Zoltan Szatmary-Ban
1e7bc0def8 Revert "Revert "Update Trusted Credentials screen in settings""
This reverts commit 0f0de0bdd021bad5f85fdb0399a4ea91a1611e25.

Change-Id: Ia3d0907e3d7c2ec42d64e45f60e3dfaffb932c3d
2014-08-15 12:55:35 +01:00
Zoltan Szatmary-Ban
678e3ecc93 Revert "Update Trusted Credentials screen in settings"
This reverts commit 4fde5aa9fab931d9becfc49f7d7b8526ad5640d9.

Change-Id: I581c38d64e9829b0079bafa42615f2aa0bf64763
2014-08-07 13:41:08 +00:00
Zoltan Szatmary-Ban
1386627335 Update Trusted Credentials screen in settings
Trusted credentials for both the primary user and its managed profiles are shown
on the Trusted Credentials fragment. All functionalities (e.g. disabling/enabling
of certificates) remain available.

Bug: 16029580

Change-Id: Ia92ae02d8c572bf4a3be172f6c255726cefc0fa1
2014-07-29 16:43:37 +01:00
Robin Lee
aab72f3b0a Merge "Revert "Revert "Publish DevicePolicyManager CA certificate APIs""" 2014-06-17 21:55:55 +00:00
Robin Lee
306fe08ce2 Revert "Revert "Publish DevicePolicyManager CA certificate APIs""
This reverts commit 792b270dbdc980cfe04e8d461bf00a1f45b5e936.

Change-Id: I18c7e0eca39868230cd8e4f4bbeb3c44ff9e8b78
2014-06-19 14:04:24 +00:00
Robin Lee
2b5e917026 Revert "Publish DevicePolicyManager CA certificate APIs"
This reverts commit 5260bf69946563dc47c17e7441b352adfce384c5.

Change-Id: I5e44fdac8a7375576b25171f58e31a1fa0e3c569
2014-06-17 22:12:28 +00:00
Robin Lee
6d3912e2ef Merge "Revert "Publish DevicePolicyManager CA certificate APIs"" 2014-06-17 21:55:55 +00:00
Robin Lee
b12f1778d6 Merge "Publish DevicePolicyManager CA certificate APIs" 2014-06-17 05:12:50 +00:00
Robin Lee
837304f6f6 Publish DevicePolicyManager CA certificate APIs
Exposes these methods:
 - hasCaCertInstalled
 - hasAnyCaCertsInstalled
 - installCaCert
 - uninstallCaCert

Allows device and profile owners to perform some certificate management
including querying for and enabling/disabling specific CA certificates.

Change-Id: I4aa8a1a8601b234e30acde99dfa382e04cb62495
2014-06-11 16:55:32 +01:00
Robert Ly
e37da759c5 am b1cb5aab: am 748856f2: am a7ddd029: am 80e84e2d: am f3cecfa2: am 55d525b2: am 716cc7dc: Add documentation for AndroidKeyStore
* commit 'b1cb5aabeb68815715eed423f1f9a7edb9a3e938':
  Add documentation for AndroidKeyStore
2014-06-11 19:33:51 +00:00
Robert Ly
80e84e2db9 am f3cecfa2: am 55d525b2: am 716cc7dc: Add documentation for AndroidKeyStore
* commit 'f3cecfa2185ef5622992b21da8204b8b6590ef2d':
  Add documentation for AndroidKeyStore
2014-06-10 02:39:28 +00:00
Robert Ly
f3cecfa218 am 55d525b2: am 716cc7dc: Add documentation for AndroidKeyStore
* commit '55d525b26b716351625798675afe69c6cf43cf5a':
  Add documentation for AndroidKeyStore
2014-06-10 02:36:10 +00:00
Robert Ly
716cc7dcac Add documentation for AndroidKeyStore
Add exposition about the use cases for AndroidKeyStore and links to the
API sample application for different use cases.

Bug: 8608817
Change-Id: Ic4ce9405781c92f12687895b28c671661ea5524f
2014-05-07 21:20:01 -07:00
Kenny Root
a365906e67 Use the correct package name for CHOOSER
Bug: 13013106
Change-Id: I1f715de18e7108274f5a98234376d48c2d329438
2014-03-17 16:21:56 -07:00
Kenny Root
1a88d834e8 KeyChain: add explicit package for getPrivateKey
Bug: 9964538
Change-Id: If67c1938e9506d4fa81b241bcbce2193d1b194ef
2014-02-07 09:14:32 -08:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Kenny Root
b91773bce1 Add argument to binder call to check key types
Before there was only one key type supported, so we didn't need to query
a key type. Now there is DSA, EC, and RSA, so there needs to be another
argument.

Bug: 10600582
Change-Id: I9fe9e46b9ec9cfb2f1246179b2c396216b2c1fdb
2013-09-05 13:27:00 -07:00
Kenny Root
c222ddd07f Unhide functions to allow ECDSA support
Bug: 10600582
Change-Id: Ic710807d7e771737521e0abd83af2f666ec1199c
2013-09-03 09:45:55 -07:00
Kenny Root
a39859889b Add support for DSA and ECDSA key types
(cherry picked from commit f64386fc26efeb245fd90fabaa47b8c8bf9b4613)

Bug: 10600582
Change-Id: I88dfcc8ca602f55fad54bd8bf043aee460c0de24
2013-09-03 00:53:04 -07:00
Maggie Benthall
da51e68e58 Add methods for managing CAs to DevicePolicyManager(Service)
Guard install/uninstall by enforcing that the caller have the new system-only permission MANAGE_CA_CERTIFICATES.
Also include API methods for asking whether there are any User CA certs
installed, or if one by a particular name is installed in the keystore.

CA certs will be installed via KeyChain into the TrustedCertificateStore.

Bug: 8232670

Change-Id: I17b47a452e72eb4fe556dc6db823a46c6e854be8
2013-08-20 14:30:36 -04:00
Elliott Hughes
a920f25fe5 resolved conflicts for merge of fca0f92e to stage-aosp-master
Change-Id: I4791f0ffa324a313b8390fbde6d8f82f716ecf74
2013-06-28 16:41:19 -07:00
Elliott Hughes
d396a448b2 Switch frameworks/base over from @hidden Charsets to public StandardCharsets.
Bug: 3484927
Change-Id: I5d136d2ee629588538602766a182ae14ce5fc63c
2013-06-28 16:24:48 -07:00
Kenny Root
5f851a89b6 am cd1de394: Merge "Track change in NativeCrypto"
* commit 'cd1de3940d9c389b6e69a7040c67d3abb8458ad2':
  Track change in NativeCrypto
2013-05-06 15:13:58 -07:00
Kenny Root
4b30e3391b Track change in NativeCrypto
Change-Id: Ic04d4ac5218795fc226f1751b6ae4db1ae73a930
2013-05-06 15:00:58 -07:00
Kenny Root
e9ae6822a8 resolved conflicts for merge of 1f6e789b to jb-mr2-dev-plus-aosp
Change-Id: I06c05d637613215b6d83df3e29cd495f6a5a0176
2013-04-29 23:09:03 -07:00
Kenny Root
12e752225a Track change to JSSE provider
Change-Id: I35e824e47ad758ab6408e91e2ba5dcda053a82f5
2013-04-29 15:15:27 -07:00
Kenny Root
1c219f6192 Rename API AndroidKey* -> Key*
Bug: 8657552
Change-Id: Id9102b7c2c2f6d27fba7645f0629750cfe1eb510
2013-04-18 18:34:58 -07:00
Kenny Root
bf2147669e AndroidKeyStore: Add encrypted flag
Add the encrypted flag for the KeyPairGenerator and the KeyStore so that
applications can choose to allow entries when there is no lockscreen.

(partial cherry pick from commit 2eeda7286f3c7cb79f7eb71ae6464cad213d12a3)

Bug: 8122243
Change-Id: I5ecd9251ec79ec53a3b68c0fff8dfba10873e36e
2013-04-15 19:33:15 +00:00
Kenny Root
4622351159 keystore: Add flag for blobs to be unencrypted
In order to let apps use keystore more productively, make the blob
encryption optional. As more hardware-assisted keystores (i.e., hardware
that has a Keymaster HAL) come around, encrypting blobs start to make
less sense since the thing it's encrypting is usually a token and not
any raw key material.

(cherry picked from commit a3788b00bb221e20abdd42f747d2af419e0a088c)

Bug: 8122243
Change-Id: Ifc1c64743651b23a4eace208ade0176af47ea989
2013-04-15 11:09:29 -07:00
Kenny Root
e7cf8c2302 keystore: remove old APIs
Remove the APIs that don't specify the flags so callers know what
they're getting.

Bug: 8122243
Change-Id: Ifaef6fb1d16010237c01f9d11f2053bb6b3980c0
2013-04-12 18:09:04 -07:00
Kenny Root
b2c0ff64d8 Remove old KeyStore call sites
Remove the call sites that don't have the flags specified. This is to
ensure that callers know what flags they're setting.

Bug: 8122243
Change-Id: Ifbd178fddbf8dbd8f7b821ea739a20d056ef9fa7
2013-04-12 18:09:04 -07:00
Kenny Root
2eeda7286f AndroidKeyStore: Add encrypted flag
Add the encrypted flag for the KeyPairGenerator and the KeyStore so that
applications can choose to allow entries when there is no lockscreen.

Bug: 8122243
Change-Id: Ia802afe965f2377ad3f282dab8c512388c705850
2013-04-12 15:19:48 -07:00
Kenny Root
a3788b00bb keystore: Add flag for blobs to be unencrypted
In order to let apps use keystore more productively, make the blob
encryption optional. As more hardware-assisted keystores (i.e., hardware
that has a Keymaster HAL) come around, encrypting blobs start to make
less sense since the thing it's encrypting is usually a token and not
any raw key material.

Bug: 8122243
Change-Id: If9af0d992d68edec006e630c687df3d03a7c9608
2013-04-10 23:36:13 -07:00
Kenny Root
8b51475c97 Revert "Remove AndroidKeyStore from API"
This reverts commit ce24985ad636c38b6ee01ec9cdecfb038bfeaeb6.

Change-Id: I02d6492c8db869619694c7209bb37522a7ec5a29
2013-04-06 10:05:31 -07:00
Kenny Root
d72317abd7 Remove keystore entries when package removed
Add a hook into PackageManagerService so that when app IDs are
completely removed, we erase all entries from keystore for those UIDs
that have gone away.

(cherry picked from commit 95e3ee3971915b323e5c13dcfe3b12a4180850cd)

Bug: 3020069
Change-Id: I374258ccc103f8cb3e238f2bf0d1afda0659db94
2013-04-03 11:32:52 -07:00
Kenny Root
95e3ee3971 Remove keystore entries when package removed
Add a hook into PackageManagerService so that when app IDs are
completely removed, we erase all entries from keystore for those UIDs
that have gone away.

Bug: 3020069
Change-Id: Id4b1d51a5fa4c418865055635a84bebcf5b65ec8
2013-04-02 11:50:16 -07:00
Kenny Root
5b7e90ac93 Add API to query KeyChain algorithm support, pt. 2
Late-breaking comments on API name. Revised.

Bug: 7095660
Change-Id: I7224d9c8a4f84a272360ede78a18bfb72d8aeb77
2013-04-02 11:23:41 -07:00
Kenny Root
bf556ac636 Add API to query KeyChain algorithm support
Bug: 7095660
Change-Id: Ia87caaa33bc01b032130811833f0a3c4f75b62d4
2013-04-02 10:34:24 -07:00
Kenny Root
5cb5cec6a4 KeyStore: add API to query storage type
Add an API to keystore daemon to query what kind of storage is currently
in use.

(cherry picked from commit a738e2a1aee26e0be3944c11820724aeca313f83)

Change-Id: I52c84449a27b1cefc49372a6406b7132c2bbddee
2013-03-29 14:21:10 -07:00