Freigeben über


DevicePolicyManager.HasKeyPair(String) Method

Definition

This API can be called by the following to query whether a certificate and private key are installed under a given alias: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul>

        If called by the credential management app, the alias must exist in the credential
        management app's <code data-dev-comment-type="c">android.security.AppUriAuthenticationPolicy</code>.
[Android.Runtime.Register("hasKeyPair", "(Ljava/lang/String;)Z", "GetHasKeyPair_Ljava_lang_String_Handler", ApiSince=31)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES")]
public virtual bool HasKeyPair (string alias);
[<Android.Runtime.Register("hasKeyPair", "(Ljava/lang/String;)Z", "GetHasKeyPair_Ljava_lang_String_Handler", ApiSince=31)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES")>]
abstract member HasKeyPair : string -> bool
override this.HasKeyPair : string -> bool

Parameters

alias
String

The alias under which the key pair is installed.

Returns

true if a key pair with this alias exists, false otherwise.

Attributes

Remarks

This API can be called by the following to query whether a certificate and private key are installed under a given alias: <ul> <li>Device owner</li> <li>Profile owner</li> <li>Delegated certificate installer</li> <li>Credential management app</li> <li>An app that holds the android.Manifest.permission#MANAGE_DEVICE_POLICY_CERTIFICATES permission</li> </ul>

If called by the credential management app, the alias must exist in the credential management app's android.security.AppUriAuthenticationPolicy.

Java documentation for android.app.admin.DevicePolicyManager.hasKeyPair(java.lang.String).

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