語言

DevicePolicyManager.InstallCaCert(ComponentName, Byte[]) 方法

定義

將所給的憑證安裝為使用者憑證。

[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

參數

admin
ComponentName

這個請求就是與該 DeviceAdminReceiver 裝置相關聯,或者 null 如果是委託憑證安裝器呼叫。

certBuffer
Byte[]

安裝憑證的編碼形式。

傳回

若無法解析 certBuffer 或安裝中斷,則為 false;否則為 true。

屬性

備註

將所給的憑證安裝為使用者憑證。

插入的使用者 CA 不會被 Android 7.0(API 等級 24)及以上的應用程式自動信任。 應用程式開發者可以透過在應用程式清單檔案中加入 安全設定檔 來更改應用程式的預設行為。

呼叫者必須是該使用者的設定檔或裝置擁有者,或是透過該#setDelegatedScopes範圍獲得#DELEGATION_CERT_INSTALL的代理套件;否則將拋出安全例外。

Java 文件 android.app.admin.DevicePolicyManager.installCaCert(android.content.ComponentName, byte[])。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於