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.
1418 1419 1420 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1418 def initialize(**args) update!(**args) end |
Instance Attribute Details
#package_names ⇒ Array<String>
The package names to which this rule applies. The signing key certificate
fingerprint of the app is verified against the signing key certificate
fingerprints provided by Play Store and ApplicationPolicy.signingKeyCerts . 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
1404 1405 1406 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1404 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
1409 1410 1411 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1409 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
1416 1417 1418 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1416 def url_pattern @url_pattern end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1423 1424 1425 1426 1427 |
# File 'lib/google/apis/androidmanagement_v1/classes.rb', line 1423 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 |