Class: Google::Apis::AndroidmanagementV1::ChoosePrivateKeyRule
- Inherits:
-
Object
- Object
- Google::Apis::AndroidmanagementV1::ChoosePrivateKeyRule
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/androidmanagement_v1/classes.rb,
lib/google/apis/androidmanagement_v1/representations.rb,
lib/google/apis/androidmanagement_v1/representations.rb
Overview
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.
Instance Attribute Summary collapse
-
#package_names ⇒ Array<String>
The package names to which this rule applies.
-
#private_key_alias ⇒ String
The alias of the private key to be used.
-
#url_pattern ⇒ String
The URL pattern to match against the URL of the request.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ChoosePrivateKeyRule
constructor
A new instance of ChoosePrivateKeyRule.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ ChoosePrivateKeyRule
Returns a new instance of ChoosePrivateKeyRule.
1034 1035 1036 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1034 def initialize(**args) update!(**args) end |
Instance Attribute Details
#package_names ⇒ Array<String>
The package names to which this rule applies. The hash of the signing
certificate for each app is verified against the hash provided by Play. If no
package names are specified, then the alias is provided to all apps that call
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 (but not without calling KeyChain.choosePrivateKeyAlias, even on
Android 11 and above). Any app with the same Android UID as a package
specified here will have access when they call KeyChain.choosePrivateKeyAlias.
Corresponds to the JSON property packageNames
1020 1021 1022 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1020 def package_names @package_names end |
#private_key_alias ⇒ String
The alias of the private key to be used.
Corresponds to the JSON property privateKeyAlias
1025 1026 1027 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1025 def private_key_alias @private_key_alias end |
#url_pattern ⇒ String
The URL pattern to match against the URL of the request. If not set or empty,
it matches all URLs. This uses the regular expression syntax of java.util.
regex.Pattern.
Corresponds to the JSON property urlPattern
1032 1033 1034 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1032 def url_pattern @url_pattern end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1039 1040 1041 1042 1043 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1039 def update!(**args) @package_names = args[:package_names] if args.key?(:package_names) @private_key_alias = args[:private_key_alias] if args.key?(:private_key_alias) @url_pattern = args[:url_pattern] if args.key?(:url_pattern) end |