From 835170e397bcc9165537cb30c8ac212e9bb2708f Mon Sep 17 00:00:00 2001 From: Rubin Xu Date: Sun, 10 Jan 2021 15:22:25 +0000 Subject: [PATCH] Add DPM.hasKeyPair() (trimmed down to only contain IKeyChainService.aidl change) The method returns true if a private key and a user certifiate are present in KeyChain under this alias. Bug: 179180345 Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testKeyManagement Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDirectly Test: atest android.admin.cts.DevicePolicyManagerTest Change-Id: I15ca6190db1ef4dbf0caabe9d46008d92f758df5 Merged-In: I15ca6190db1ef4dbf0caabe9d46008d92f758df5 --- keystore/java/android/security/IKeyChainService.aidl | 1 + 1 file changed, 1 insertion(+) diff --git a/keystore/java/android/security/IKeyChainService.aidl b/keystore/java/android/security/IKeyChainService.aidl index 97da3cc6f80f5..1ae6a631dbcb8 100644 --- a/keystore/java/android/security/IKeyChainService.aidl +++ b/keystore/java/android/security/IKeyChainService.aidl @@ -46,6 +46,7 @@ interface IKeyChainService { boolean installKeyPair( in byte[] privateKey, in byte[] userCert, in byte[] certChain, String alias, int uid); boolean removeKeyPair(String alias); + boolean containsKeyPair(String alias); // APIs used by Settings boolean deleteCaCertificate(String alias);