RegisterCredentialsRequest


public abstract class RegisterCredentialsRequest

Known direct subclasses
DigitalCredentialRegistry

A request to register digital credentials with Credential Manager.

Known indirect subclasses
PreviewRegistry

A registration request containing data that can serve the preview protocol based request.


A request to register credentials with Credential Manager.

Summary

Public constructors

RegisterCredentialsRequest(
    @NonNull String type,
    @NonNull String id,
    @NonNull byte[] credentials,
    @NonNull byte[] matcher,
    @NonNull String intentAction
)

Public methods

final @NonNull byte[]

the credentials to register

final @NonNull String

the unique id that identifies this registry, such that it won't be overwritten by other different registries of the same type

final @NonNull String

the intent action that will be used to launch your fulfillment activity when one of your credentials was chosen by the user, default to 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 @NonNull byte[]

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

the type of the credentials being registered; this matches the androidx.credentials.Credential.type that these registered credentials will be returned as

Public constructors

RegisterCredentialsRequest

Added in 1.0.0-alpha01
public RegisterCredentialsRequest(
    @NonNull String type,
    @NonNull String id,
    @NonNull byte[] credentials,
    @NonNull byte[] matcher,
    @NonNull String intentAction
)

Public methods

getCredentials

Added in 1.0.0-alpha01
public final @NonNull byte[] getCredentials()

the credentials to register

getId

Added in 1.0.0-alpha01
public final @NonNull String getId()

the unique id that identifies this registry, such that it won't be overwritten by other different registries of the same type

getIntentAction

Added in 1.0.0-alpha01
public final @NonNull String 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 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

getMatcher

Added in 1.0.0-alpha01
public final @NonNull byte[] 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 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

getType

Added in 1.0.0-alpha01
public final @NonNull String getType()

the type of the credentials being registered; this matches the androidx.credentials.Credential.type that these registered credentials will be returned as