Język

DevicePolicyManager.HasKeyPair Method

Definition

Overloads

Name Description
HasKeyPair(String)

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>.
HasKeyPair(String, KeyChainManagerKeyPairScope)

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

HasKeyPair(String)

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

HasKeyPair(String, KeyChainManagerKeyPairScope)

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

[Android.Runtime.Register("hasKeyPair", "(Ljava/lang/String;I)Z", "GetHasKeyPair_Ljava_lang_String_IHandler", ApiSince=37)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES")]
public virtual bool HasKeyPair(string alias, Android.Security.KeyChainManagerKeyPairScope scope);
[<Android.Runtime.Register("hasKeyPair", "(Ljava/lang/String;I)Z", "GetHasKeyPair_Ljava_lang_String_IHandler", ApiSince=37)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES")>]
abstract member HasKeyPair : string * Android.Security.KeyChainManagerKeyPairScope -> bool
override this.HasKeyPair : string * Android.Security.KeyChainManagerKeyPairScope -> bool

Parameters

alias
String

The alias under which the key pair is installed.

scope
KeyChainManagerKeyPairScope

The scope of the key pair: KeyChainManager#KEYPAIR_SCOPE_USER or KeyChainManager#KEYPAIR_SCOPE_DEVICE.

Returns

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

Attributes

Applies to