Class ConnectionOptions.Builder
-
- All Implemented Interfaces:
public class ConnectionOptions.BuilderA builder to create connection options for the EmrtdConnector.
-
-
Constructor Summary
Constructors Constructor Description ConnectionOptions.Builder()
-
Method Summary
Modifier and Type Method Description ConnectionOptions.BuildersetChipAccessKeyFromCan(String can)Sets the access key for the chip access procedure to authenticate to the chip of the eMRTD. ConnectionOptions.BuildersetChipAccessKeyFromMrz(String documentNumber, String dateOfBirth, String dateOfExpiry)Sets the access key for the chip access procedure to authenticate to the chip of the eMRTD. ConnectionOptionsbuild()Build the connection options. ConnectionOptions.BuildersetChipAccessKey(ChipAccessKey chipAccessKey)Sets the access key for the chip access procedure to authenticate to the chip of the eMRTD. ConnectionOptions.BuildersetValidationId(String validationId)Sets an unique string to identify the session. ConnectionOptions.BuildersetEnableDiagnostics(boolean enableDiagnostics)Enable or disable collection of diagnostics. ConnectionOptions.BuildersetBaggage(Map<String, String> baggage)Sets the baggage entries that become the log context of the session in the DocVal server. ConnectionOptions.BuildersetHttpHeaders(Map<String, String> httpHeaders)Sets additional HTTP headers that will be set for the websocket connection. -
-
Method Detail
-
setChipAccessKeyFromCan
ConnectionOptions.Builder setChipAccessKeyFromCan(String can)
Sets the access key for the chip access procedure to authenticate to the chip of the eMRTD.
Uses the Card Access Number (CAN) as the access key.
- Parameters:
can- The Card Access Number.- Returns:
This instance of the builder for easier chaining.
-
setChipAccessKeyFromMrz
ConnectionOptions.Builder setChipAccessKeyFromMrz(String documentNumber, String dateOfBirth, String dateOfExpiry)
Sets the access key for the chip access procedure to authenticate to the chip of the eMRTD.
Uses details from the MRZ as the access key.
- Parameters:
documentNumber- The document number.dateOfBirth- The birth date of the document holder.dateOfExpiry- The expiry date of the document.- Returns:
This instance of the builder for easier chaining.
-
build
ConnectionOptions build()
Build the connection options.
- Returns:
The connection options.
-
setChipAccessKey
ConnectionOptions.Builder setChipAccessKey(ChipAccessKey chipAccessKey)
Sets the access key for the chip access procedure to authenticate to the chip of the eMRTD.
- Parameters:
chipAccessKey- The key to set.- Returns:
This instance of the builder for easier chaining.
-
setValidationId
ConnectionOptions.Builder setValidationId(String validationId)
Sets an unique string to identify the session.
- Parameters:
validationId- The validation id.- Returns:
This instance of the builder for easier chaining.
-
setEnableDiagnostics
ConnectionOptions.Builder setEnableDiagnostics(boolean enableDiagnostics)
Enable or disable collection of diagnostics.
When enabled, the DocVal server will collect and store extra diagnostic information to troubleshoot issues.
This information may contain personal data, so only enable it if you have user consent.
- Parameters:
enableDiagnostics-trueto turn on diagnostics.- Returns:
This instance of the builder for easier chaining.
-
setBaggage
ConnectionOptions.Builder setBaggage(Map<String, String> baggage)
Sets the baggage entries that become the log context of the session in the DocVal server.
The server adds the entries as fields to every log line of the session. It only takes keys that are on its allow-list.
The entries go into the
baggageheader of the handshake, as defined by W3C Baggage. This method encodes the values, sorts the entries by key, and replaces abaggageheader from setHttpHeaders. A key must be a token of RFC 7230 and a value must not be empty. An entry that the method cannot send is dropped with a warning in the log. The method never throws.nullor an empty map removes the entries.- Parameters:
baggage- The baggage entries.- Returns:
This instance of the builder for easier chaining.
-
setHttpHeaders
ConnectionOptions.Builder setHttpHeaders(Map<String, String> httpHeaders)
Sets additional HTTP headers that will be set for the websocket connection.
Can for example be used to set an Authorization header.
- Parameters:
httpHeaders- The http headers.- Returns:
This instance of the builder for easier chaining.
-
-
-
-