IdentityCredentialStoreCapabilities


public class 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 getSystemAvailableFeatures and hasSystemFeature. The feature names in question are android.hardware.identity_credential andandroid.hardware.identity_credential_direct_access for the direct access store.

Known feature versions include FEATURE_VERSION_202009 and FEATURE_VERSION_202101.

Summary

Constants

static final int

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

static final int

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

Public methods

int

Returns the feature version of the IdentityCredentialStore.

@NonNull Set<String>

Gets a set of supported document types.

boolean

Returns whether delete is supported by the underlying hardware.

boolean

Returns whether the credential store is for direct access.

boolean

Returns whether the credential is backed by Secure Hardware.

boolean

Returns true if proveOwnership is supported by the underlying hardware.

boolean

Returns true if storeStaticAuthenticationData is supported by the underlying hardware.

boolean

Returns true if update is supported by the underlying hardware.

Constants

FEATURE_VERSION_202009

Added in 1.0.0-alpha04
public static final int FEATURE_VERSION_202009 = 202009

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

FEATURE_VERSION_202101

Added in 1.0.0-alpha04
public static final int FEATURE_VERSION_202101 = 202101

The feature version corresponding to features included in the Identity Credential API shipped in Android 12. This feature version adds support for delete, update, proveOwnership, and storeStaticAuthenticationData.

Public methods

getFeatureVersion

Added in 1.0.0-alpha04
public int getFeatureVersion()

Returns the feature version of the IdentityCredentialStore.

Returns
int

the feature version.

getSupportedDocTypes

Added in 1.0.0-alpha04
public @NonNull Set<StringgetSupportedDocTypes()

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
@NonNull Set<String>

The supported document types or the empty set if any document type is supported.

isDeleteSupported

Added in 1.0.0-alpha04
public boolean isDeleteSupported()

Returns whether delete 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

Added in 1.0.0-alpha04
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

Added in 1.0.0-alpha04
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

Added in 1.0.0-alpha04
public boolean isProveOwnershipSupported()

Returns true if proveOwnership 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

Added in 1.0.0-alpha04
public boolean isStaticAuthenticationDataExpirationSupported()

Returns true if storeStaticAuthenticationData 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

Added in 1.0.0-alpha04
public boolean isUpdateSupported()

Returns true if update 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.