Class VerificationHelper.Builder
- java.lang.Object
-
- com.android.identity.VerificationHelper.Builder
-
- Enclosing class:
- VerificationHelper
public static class VerificationHelper.Builder extends java.lang.Object
Builder forVerificationHelper
.
-
-
Constructor Summary
Constructors Constructor Description Builder(android.content.Context context, VerificationHelper.Listener listener, java.util.concurrent.Executor executor)
Creates a new Builder forVerificationHelper
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerificationHelper
build()
Builds aVerificationHelper
with the configuration specified in the builder.VerificationHelper.Builder
setDataTransportOptions(DataTransportOptions options)
Sets the options to use when setting up transports.VerificationHelper.Builder
setUseReverseEngagement(java.util.List<ConnectionMethod> connectionMethods)
Configures the verification helper to use reverse engagement.
-
-
-
Constructor Detail
-
Builder
public Builder(@NonNull android.content.Context context, @NonNull VerificationHelper.Listener listener, @NonNull java.util.concurrent.Executor executor)
Creates a new Builder forVerificationHelper
.- Parameters:
context
- application context.listener
- listener.executor
- executor.
-
-
Method Detail
-
setDataTransportOptions
@NonNull public VerificationHelper.Builder setDataTransportOptions(DataTransportOptions options)
Sets the options to use when setting up transports.- Parameters:
options
- the options to use.- Returns:
- the builder.
-
setUseReverseEngagement
@NonNull public VerificationHelper.Builder setUseReverseEngagement(@NonNull java.util.List<ConnectionMethod> connectionMethods)
Configures the verification helper to use reverse engagement.- Parameters:
connectionMethods
- a list of connection methods to offer via reverse engagement- Returns:
- the builder.
-
build
@NonNull public VerificationHelper build()
Builds aVerificationHelper
with the configuration specified in the builder.If using normal engagement and the application wishes to use NFC engagement it should use
NfcAdapter
and pass received tags toVerificationHelper.nfcProcessOnTagDiscovered(Tag)
. For QR engagement the application is expected to capture the QR code itself and pass it usingVerificationHelper.setDeviceEngagementFromQrCode(String)
. When engagement with a mdoc is detectedVerificationHelper.Listener.onDeviceEngagementReceived(List)
is called with a list of possible transports and the application is expected to pick a transport and pass it toVerificationHelper.connect(ConnectionMethod)
.If using reverse engagement, the application should wait for the
VerificationHelper.Listener.onReaderEngagementReady(byte[])
callback and then convey the reader engagement to the mdoc, for example via QR code or sending an mdoc:// URI to a suitable user agent. After this, application should wait for theVerificationHelper.Listener.onDeviceConnected()
callback which is called when the mdoc connects via one of the connection methods specified usingsetUseReverseEngagement(List)
.When the application is done interacting with the mdoc it should call
VerificationHelper.disconnect()
.- Returns:
- A
VerificationHelper
.
-
-