Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6968,6 +6968,7 @@ package android.app.admin { method public boolean grantKeyPairToApp(@Nullable android.content.ComponentName, @NonNull String, @NonNull String); method public boolean hasCaCertInstalled(@Nullable android.content.ComponentName, byte[]); method public boolean hasGrantedPolicy(@NonNull android.content.ComponentName, int); method public boolean hasKeyPair(@NonNull String); method public boolean hasLockdownAdminConfiguredNetworks(@NonNull android.content.ComponentName); method public boolean installCaCert(@Nullable android.content.ComponentName, byte[]); method public boolean installExistingPackage(@NonNull android.content.ComponentName, String); core/java/android/app/admin/DevicePolicyManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -5370,6 +5370,27 @@ public class DevicePolicyManager { } } // STOPSHIP(b/174298501): clarify the expected return value following generateKeyPair call. /** * Called by a device or profile owner, or delegated certificate installer, to query whether a * certificate and private key are installed under a given alias. * * @param alias The alias under which the key pair is installed. * @return {@code true} if a key pair with this alias exists, {@code false} otherwise. * @throws SecurityException if the caller is not a device or profile owner or a delegated * certificate installer. * @see #setDelegatedScopes * @see #DELEGATION_CERT_INSTALL */ public boolean hasKeyPair(@NonNull String alias) { throwIfParentInstance("hasKeyPair"); try { return mService.hasKeyPair(mContext.getPackageName(), alias); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Called by a device or profile owner, or delegated certificate installer, to generate a * new private/public key pair. If the device supports key generation via secure hardware, Loading core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ interface IDevicePolicyManager { in byte[] certBuffer, in byte[] certChainBuffer, String alias, boolean requestAccess, boolean isUserSelectable); boolean removeKeyPair(in ComponentName who, in String callerPackage, String alias); boolean hasKeyPair(in String callerPackage, in String alias); boolean generateKeyPair(in ComponentName who, in String callerPackage, in String algorithm, in ParcelableKeyGenParameterSpec keySpec, in int idAttestationFlags, out KeymasterCertificateChain attestationChain); Loading keystore/java/android/security/IKeyChainService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -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); Loading services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -101,4 +101,9 @@ abstract class BaseIDevicePolicyManager extends IDevicePolicyManager.Stub { public boolean canProfileOwnerResetPasswordWhenLocked(int userId) { return false; } public boolean hasKeyPair(String callerPackage, String alias) { // STOPSHIP: implement delegation code in ArcDevicePolicyManagerWrapperService & nuke this. return false; } } Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6968,6 +6968,7 @@ package android.app.admin { method public boolean grantKeyPairToApp(@Nullable android.content.ComponentName, @NonNull String, @NonNull String); method public boolean hasCaCertInstalled(@Nullable android.content.ComponentName, byte[]); method public boolean hasGrantedPolicy(@NonNull android.content.ComponentName, int); method public boolean hasKeyPair(@NonNull String); method public boolean hasLockdownAdminConfiguredNetworks(@NonNull android.content.ComponentName); method public boolean installCaCert(@Nullable android.content.ComponentName, byte[]); method public boolean installExistingPackage(@NonNull android.content.ComponentName, String);
core/java/android/app/admin/DevicePolicyManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -5370,6 +5370,27 @@ public class DevicePolicyManager { } } // STOPSHIP(b/174298501): clarify the expected return value following generateKeyPair call. /** * Called by a device or profile owner, or delegated certificate installer, to query whether a * certificate and private key are installed under a given alias. * * @param alias The alias under which the key pair is installed. * @return {@code true} if a key pair with this alias exists, {@code false} otherwise. * @throws SecurityException if the caller is not a device or profile owner or a delegated * certificate installer. * @see #setDelegatedScopes * @see #DELEGATION_CERT_INSTALL */ public boolean hasKeyPair(@NonNull String alias) { throwIfParentInstance("hasKeyPair"); try { return mService.hasKeyPair(mContext.getPackageName(), alias); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Called by a device or profile owner, or delegated certificate installer, to generate a * new private/public key pair. If the device supports key generation via secure hardware, Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ interface IDevicePolicyManager { in byte[] certBuffer, in byte[] certChainBuffer, String alias, boolean requestAccess, boolean isUserSelectable); boolean removeKeyPair(in ComponentName who, in String callerPackage, String alias); boolean hasKeyPair(in String callerPackage, in String alias); boolean generateKeyPair(in ComponentName who, in String callerPackage, in String algorithm, in ParcelableKeyGenParameterSpec keySpec, in int idAttestationFlags, out KeymasterCertificateChain attestationChain); Loading
keystore/java/android/security/IKeyChainService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -101,4 +101,9 @@ abstract class BaseIDevicePolicyManager extends IDevicePolicyManager.Stub { public boolean canProfileOwnerResetPasswordWhenLocked(int userId) { return false; } public boolean hasKeyPair(String callerPackage, String alias) { // STOPSHIP: implement delegation code in ArcDevicePolicyManagerWrapperService & nuke this. return false; } }