# DigitalCredentialRegistry

Artifact: [androidx.credentials.registry:registry-provider](https://developer.android.com/jetpack/androidx/releases/credentials-registry) [View Source](https://cs.android.com/search?q=file:androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialRegistry.kt+class:androidx.credentials.registry.provider.digitalcredentials.DigitalCredentialRegistry) Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

*** ** * ** ***

<br />

```
public abstract class DigitalCredentialRegistry extends RegisterCredentialsRequest
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.credentials.registry.provider.RegisterCredentialsRequest](https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest) ||
|   | ↳ | [androidx.credentials.registry.provider.digitalcredentials.DigitalCredentialRegistry](https://developer.android.com/reference/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialRegistry) |

Known direct subclasses [OpenId4VpRegistry](https://developer.android.com/reference/androidx/credentials/registry/digitalcredentials/openid4vp/OpenId4VpRegistry)

|---|---|
| `https://developer.android.com/reference/androidx/credentials/registry/digitalcredentials/openid4vp/OpenId4VpRegistry` | A registration request containing data that can serve the [OpenID for Verifiable Presentations protocol](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html) based request. |

*** ** * ** ***

A request to register digital credentials with Credential Manager.

The (`https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#type()`, `https://developer.android.com/reference/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialRegistry#(kotlin.String,kotlin.ByteArray,kotlin.ByteArray,kotlin.String)`) properties together act as a primary key for this registry record stored with the Registry Manager. You later can use them to perform overwrite or deletion.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialRegistry#DISPLAY_TYPE_VERIFICATION() = 0` The credential should be displayed with the UI styles that serves the verification use case. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialRegistry#DigitalCredentialRegistry(kotlin.String,kotlin.ByteArray,kotlin.ByteArray,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id, @https://developer.android.com/reference/androidx/annotation/NonNull byte[] credentials, @https://developer.android.com/reference/androidx/annotation/NonNull byte[] matcher, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html intentAction )` |

### Inherited methods

From [androidx.credentials.registry.provider.RegisterCredentialsRequest](https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest) `final @https://developer.android.com/reference/androidx/annotation/NonNull byte[]` `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#getCredentials()()`

the credentials to register
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#getId()()`

the unique id that identifies this registry, such that it won't be overwritten by other different registries of the same `type`
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#getIntentAction()()`

the intent action that will be used to launch your fulfillment activity when one of your credentials was chosen by the user, default to `https://developer.android.com/reference/androidx/credentials/registry/provider/RegistryManager#ACTION_GET_CREDENTIAL()` when unspecified; when Credential Manager launches your fulfillment activity, it will build an intent with the given `intentAction` targeting your package, so this is useful when you need to define different fulfillment activities for different registries
`final @https://developer.android.com/reference/androidx/annotation/NonNull byte[]` `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#getMatcher()()`

the matcher wasm binary in bytes; the matcher will be interpreted and run in a safe and privacy-preserving sandbox upon an incoming request and it should output the qualified credentials given the `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#credentials()` and the request; an invalid matcher (e.g. one that fails wasm interpretation or causes exceptions) will mean that your credentials will never be surfaced to the user
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/credentials/registry/provider/RegisterCredentialsRequest#getType()()`

the type of the credentials being registered; this matches the `https://developer.android.com/reference/androidx/credentials/Credential#type()` that these registered credentials will be returned as

## Constants

### DISPLAY_TYPE_VERIFICATION

```
public static final int DISPLAY_TYPE_VERIFICATION = 0
```

The credential should be displayed with the UI styles that serves the verification use case. This is the default use case.

## Public constructors

### DigitalCredentialRegistry

Added in [1.0.0-alpha05](https://developer.android.com/jetpack/androidx/releases/credentials-registry#1.0.0-alpha05)

```
public DigitalCredentialRegistry(
    @NonNull String id,
    @NonNull byte[] credentials,
    @NonNull byte[] matcher,
    @NonNull String intentAction
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id` | the unique id that identifies this registry, such that it won't be overwritten by other different registries of the same `type`; in other words, registering the registry with the same id will overwrite the existing one when applicable |
| `@https://developer.android.com/reference/androidx/annotation/NonNull byte[] credentials` | the credentials in raw bytes |
| `@https://developer.android.com/reference/androidx/annotation/NonNull byte[] matcher` | the matcher wasm binary in bytes; the matcher will be interpreted and run in a safe and privacy-preserving sandbox upon an incoming request and it should output the qualified credentials given the `https://developer.android.com/reference/androidx/credentials/registry/provider/digitalcredentials/DigitalCredentialRegistry#(kotlin.String,kotlin.ByteArray,kotlin.ByteArray,kotlin.String)` and the request |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html intentAction` | the intent action that will be used to launch your fulfillment activity when one of your credentials was chosen by the user, default to `https://developer.android.com/reference/androidx/credentials/registry/provider/RegistryManager#ACTION_GET_CREDENTIAL()` when unspecified; when Credential Manager launches your fulfillment activity, it will build an intent with the given `intentAction` targeting your package, so this is useful when you need to define different fulfillment activities for different registries |