共用方式為


DevicePolicyManager.GetKeyPairGrants(String) Method

Definition

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to query which apps have access to a given KeyChain key.

[Android.Runtime.Register("getKeyPairGrants", "(Ljava/lang/String;)Ljava/util/Map;", "GetGetKeyPairGrants_Ljava_lang_String_Handler", ApiSince=31)]
public virtual System.Collections.Generic.IDictionary<Java.Lang.Integer,System.Collections.Generic.ICollection<string>> GetKeyPairGrants (string alias);
[<Android.Runtime.Register("getKeyPairGrants", "(Ljava/lang/String;)Ljava/util/Map;", "GetGetKeyPairGrants_Ljava_lang_String_Handler", ApiSince=31)>]
abstract member GetKeyPairGrants : string -> System.Collections.Generic.IDictionary<Java.Lang.Integer, System.Collections.Generic.ICollection<string>>
override this.GetKeyPairGrants : string -> System.Collections.Generic.IDictionary<Java.Lang.Integer, System.Collections.Generic.ICollection<string>>

Parameters

alias
String

The alias of the key to grant access to.

Returns

apps that have access to a given key, arranged in a map from UID to sets of package names.

Attributes

Remarks

Called by a device or profile owner, or delegated certificate chooser (an app that has been delegated the #DELEGATION_CERT_SELECTION privilege), to query which apps have access to a given KeyChain key.

Key are granted on a per-UID basis, so if several apps share the same UID, granting access to one of them automatically grants it to others. This method returns a map containing one entry per grantee UID. Entries have UIDs as keys and sets of corresponding package names as values. In particular, grantee packages that don't share UID with other packages are represented by entries having singleton sets as values.

Java documentation for android.app.admin.DevicePolicyManager.getKeyPairGrants(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