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
This commit is contained in:
Maggie Benthall
2013-08-08 22:35:44 -04:00
parent 0a94b9ce27
commit da51e68e58
7 changed files with 178 additions and 2 deletions

View File

@ -443,7 +443,10 @@ public final class KeyChain {
}
@Override public void onServiceDisconnected(ComponentName name) {}
};
boolean isBound = context.bindService(new Intent(IKeyChainService.class.getName()),
Intent intent = new Intent(IKeyChainService.class.getName());
ComponentName comp = intent.resolveSystemService(context.getPackageManager(), 0);
intent.setComponent(comp);
boolean isBound = context.bindService(intent,
keyChainServiceConnection,
Context.BIND_AUTO_CREATE);
if (!isBound) {