ChoosePrivateKeyRule class

Controls apps' access to private keys.

The rule determines which private key, if any, Android Device Policy grants to the specified app. Access is granted either when the app calls KeyChain.choosePrivateKeyAlias (https://developer.android.com/reference/android/security/KeyChain#choosePrivateKeyAlias%28android.app.Activity,%20android.security.KeyChainAliasCallback,%20java.lang.String\[\],%20java.security.Principal\[\],%20java.lang.String,%20int,%20java.lang.String%29) (or any overloads) to request a private key alias for a given URL, or for rules that are not URL-specific (that is, if urlPattern is not set, or set to the empty string or .*) on Android 11 and above, directly so that the app can call KeyChain.getPrivateKey (https://developer.android.com/reference/android/security/KeyChain#getPrivateKey%28android.content.Context,%20java.lang.String%29), without first having to call KeyChain.choosePrivateKeyAlias.When an app calls KeyChain.choosePrivateKeyAlias if more than one choosePrivateKeyRules matches, the last matching rule defines which key alias to return.

Constructors

ChoosePrivateKeyRule({List<String>? packageNames, String? privateKeyAlias, String? urlPattern})
ChoosePrivateKeyRule.fromJson(Map json_)

Properties

hashCode int
The hash code for this object.
no setterinherited
packageNames List<String>?
The package names to which this rule applies.
getter/setter pair
privateKeyAlias String?
The alias of the private key to be used.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
urlPattern String?
The URL pattern to match against the URL of the request.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited