Google 致力于为黑人社区推动种族平等。查看具体举措

IdentityCredentialStoreCapabilities

public class IdentityCredentialStoreCapabilities
extends Object

java.lang.Object
   ↳ androidx.security.identity.IdentityCredentialStoreCapabilities


A class that supports querying the capabilities of a IdentityCredentialStore as implemented in secure hardware or in software (backed by Android Keystore).

Capabilities depend on the Android system features and can be queried using PackageManager.getSystemAvailableFeatures() and PackageManager.hasSystemFeature(String, int). The feature names in question are android.hardware.identity_credential and android.hardware.identity_credential_direct_access for the direct access store.

Known feature versions include FEATURE_VERSION_202009 and FEATURE_VERSION_202101.

Summary

Constants

int FEATURE_VERSION_202009

The feature version corresponding to features included in the Identity Credential API shipped in Android 11.

int FEATURE_VERSION_202101

The feature version corresponding to features included in the Identity Credential API shipped in Android 12.

Public methods

int getFeatureVersion()

Returns the feature version of the IdentityCredentialStore.

Set<String> getSupportedDocTypes()

Gets a set of supported document types.

boolean isDeleteSupported()

Returns whether IdentityCredential.delete(byte[]) is supported by the underlying hardware.

boolean isDirectAccess()

Returns whether the credential store is for direct access.

boolean isHardwareBacked()

Returns whether the credential is backed by Secure Hardware.

boolean isProveOwnershipSupported()

Returns true if IdentityCredential.proveOwnership(byte[]) is supported by the underlying hardware.

boolean isStaticAuthenticationDataExpirationSupported()

Returns true if IdentityCredential.storeStaticAuthenticationData(X509Certificate, Calendar, byte[]) is supported by the underlying hardware.

boolean isUpdateSupported()

Returns true if IdentityCredential.update(PersonalizationData) is supported by the underlying hardware.

Inherited methods

Constants

FEATURE_VERSION_202009

public static final int FEATURE_VERSION_202009

The feature version corresponding to features included in the Identity Credential API shipped in Android 11.

Constant Value: 202009 (0x00031519)

FEATURE_VERSION_202101

public static final int FEATURE_VERSION_202101

The feature version corresponding to features included in the Identity Credential API shipped in Android 12. This feature version adds support for IdentityCredential.delete(byte[]), IdentityCredential.update(PersonalizationData), IdentityCredential.proveOwnership(byte[]), and IdentityCredential.storeStaticAuthenticationData(X509Certificate, Calendar, byte[]).

Constant Value: 202101 (0x00031575)

Public methods

getFeatureVersion

public int getFeatureVersion ()

Returns the feature version of the IdentityCredentialStore.

Returns
int the feature version.

getSupportedDocTypes

public Set<String> getSupportedDocTypes ()

Gets a set of supported document types.

Only the direct-access store may restrict the kind of document types that can be used for credentials. The default store always supports any document type.

This always return the empty set for the software-based store.

Returns
Set<String> The supported document types or the empty set if any document type is supported.

isDeleteSupported

public boolean isDeleteSupported ()

Returns whether IdentityCredential.delete(byte[]) is supported by the underlying hardware.

This is supported in feature version FEATURE_VERSION_202101 and later.

This is always supported by the software-based store.

Returns
boolean true if supported, false if not.

isDirectAccess

public boolean isDirectAccess ()

Returns whether the credential store is for direct access.

This always return false for the software-based store.

Returns
boolean true if credential store is for direct access, false if not.

isHardwareBacked

public boolean isHardwareBacked ()

Returns whether the credential is backed by Secure Hardware.

This always return false for the software-based store.

Note that the software-based store is still using Android Keystore which itself is backed by secure hardware.

Returns
boolean true if backed by secure hardware, false if not.

isProveOwnershipSupported

public boolean isProveOwnershipSupported ()

Returns true if IdentityCredential.proveOwnership(byte[]) is supported by the underlying hardware.

This is supported in feature version FEATURE_VERSION_202101 and later.

This is always supported by the software-based store.

Returns
boolean true if supported, false if not.

isStaticAuthenticationDataExpirationSupported

public boolean isStaticAuthenticationDataExpirationSupported ()

Returns true if IdentityCredential.storeStaticAuthenticationData(X509Certificate, Calendar, byte[]) is supported by the underlying hardware.

This is supported in feature version FEATURE_VERSION_202101 and later.

This is always supported by the software-based store.

Returns
boolean true if supported, false if not.

isUpdateSupported

public boolean isUpdateSupported ()

Returns true if IdentityCredential.update(PersonalizationData) is supported by the underlying hardware.

This is supported in feature version FEATURE_VERSION_202101 and later.

This is always supported by the software-based store.

Returns
boolean true if supported, false if not.