DevicePolicyManager.InstallCaCert(ComponentName, Byte[]) Method

Definition

Installs the given certificate as a user CA.

[Android.Runtime.Register("installCaCert", "(Landroid/content/ComponentName;[B)Z", "GetInstallCaCert_Landroid_content_ComponentName_arrayBHandler")]
public virtual bool InstallCaCert (Android.Content.ComponentName? admin, byte[]? certBuffer);
[<Android.Runtime.Register("installCaCert", "(Landroid/content/ComponentName;[B)Z", "GetInstallCaCert_Landroid_content_ComponentName_arrayBHandler")>]
abstract member InstallCaCert : Android.Content.ComponentName * byte[] -> bool
override this.InstallCaCert : Android.Content.ComponentName * byte[] -> bool

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with, or null if calling from a delegated certificate installer.

certBuffer
Byte[]

encoded form of the certificate to install.

Returns

false if the certBuffer cannot be parsed or installation is interrupted, true otherwise.

Attributes

Remarks

Installs the given certificate as a user CA.

Inserted user CAs aren't automatically trusted by apps in Android 7.0 (API level 24) and higher. App developers can change the default behavior for an app by adding a Security Configuration File to the app manifest file.

The caller must be a profile or device owner on that user, or a delegate package given the #DELEGATION_CERT_INSTALL scope via #setDelegatedScopes; otherwise a security exception will be thrown.

Java documentation for android.app.admin.DevicePolicyManager.installCaCert(android.content.ComponentName, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to