Share via


DelegatedAdminReceiver.OnChoosePrivateKeyAlias Method

Definition

Allows this receiver to select the alias for a private key and certificate pair for authentication.

[Android.Runtime.Register("onChoosePrivateKeyAlias", "(Landroid/content/Context;Landroid/content/Intent;ILandroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;", "GetOnChoosePrivateKeyAlias_Landroid_content_Context_Landroid_content_Intent_ILandroid_net_Uri_Ljava_lang_String_Handler", ApiSince=29)]
public virtual string? OnChoosePrivateKeyAlias (Android.Content.Context context, Android.Content.Intent intent, int uid, Android.Net.Uri? uri, string? alias);
[<Android.Runtime.Register("onChoosePrivateKeyAlias", "(Landroid/content/Context;Landroid/content/Intent;ILandroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;", "GetOnChoosePrivateKeyAlias_Landroid_content_Context_Landroid_content_Intent_ILandroid_net_Uri_Ljava_lang_String_Handler", ApiSince=29)>]
abstract member OnChoosePrivateKeyAlias : Android.Content.Context * Android.Content.Intent * int * Android.Net.Uri * string -> string
override this.OnChoosePrivateKeyAlias : Android.Content.Context * Android.Content.Intent * int * Android.Net.Uri * string -> string

Parameters

context
Context

The running context as per #onReceive.

intent
Intent

The received intent as per #onReceive.

uid
Int32

The uid of the app asking for the private key and certificate pair.

uri
Uri

The URI to authenticate, may be null.

alias
String

The alias preselected by the client, or null.

Returns

The private key alias to return and grant access to.

Attributes

Remarks

Allows this receiver to select the alias for a private key and certificate pair for authentication. If this method returns null, the default android.app.Activity will be shown that lets the user pick a private key and certificate pair. If this method returns KeyChain#KEY_ALIAS_SELECTION_DENIED, the default android.app.Activity will not be shown and the user will not be allowed to pick anything. And the app, that called KeyChain#choosePrivateKeyAlias, will receive null back.

This callback is only applicable if the delegated app has DevicePolicyManager#DELEGATION_CERT_SELECTION capability. Additionally, it must declare an intent filter for DeviceAdminReceiver#ACTION_CHOOSE_PRIVATE_KEY_ALIAS in the receiver's manifest in order to receive this callback. The default implementation simply throws UnsupportedOperationException.

Java documentation for android.app.admin.DelegatedAdminReceiver.onChoosePrivateKeyAlias(android.content.Context, android.content.Intent, int, android.net.Uri, 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