OSDN Git Service

CredentialStorage: Install keys using KeyChain
authorEran Messeri <eranm@google.com>
Tue, 10 Sep 2019 16:40:28 +0000 (17:40 +0100)
committerEran Messeri <eranm@google.com>
Thu, 12 Sep 2019 14:54:30 +0000 (15:54 +0100)
commitd83c190f2957a67c1df398a86ab5116da7002c0a
treefb4a1b040d1b1cc03848e883f013d9df9e660832
parentce024a0dc5376522b29639da60460a0cfc1fd52c
CredentialStorage: Install keys using KeyChain

This is part of the work to unify the manual certificate
installation flow (via "Install from storage" in the Settings
app) with the programmatic one (using
DevicePolicyManager.installKeyPair).

The change to CredentialStorage is the crux of this work, where
the key is no longer installed by calling Keystore directly.

Instead, a new AsyncTask, InstallKeyInKeyChain, was created, which
calls KeyChainService.installKeyPair with the key data and associated
certificates (as well as the UID of the designated service, to allow
installation into the WiFi Keystore).

Once that task completes, if the key was installed successfully,
then it is marked as user-selectable.

Test: Manual CtsVerifier tests: KeyChain Storage Test, CA Cert Notification Test
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t  com.android.cts.devicepolicy.MixedDeviceOwnerTest#testKeyManagement
Bug: 138375478
Change-Id: I7c4b4ea725a34307f58d27252c2958771001636f
src/com/android/settings/security/CredentialStorage.java