ChipReadOptions

class ChipReadOptions @JvmOverloads constructor(val accessKey: ChipAccessKey, val dataGroups: Set<Int> = setOf(1, 2), val trustAnchors: List<TrustAnchor> = emptyList(), val checkTime: Instant? = null, val allowExtendedLength: Boolean = true, val signerCertificate: DocumentSignerCertificate? = null, val allowCheckDigitMismatch: Boolean = false, val printedDocument: MrzDocument? = null)

What ChipReader.read should do.

Kotlin callers use the constructor with named arguments; Java and Swift callers can use Builder.

Who clears the key. The low-level ChipReader.read does not clear accessKey: the caller owns it. The high-level entry points (NfcChipRead on Android, CoreNfcChipRead on iOS) take the key over for the length of the read and clear it at its ending, whatever the ending is; read the entry point's documentation. Either way a key is for one person's action: make a new one for the next read.

Experimental: see ExperimentalTesseraChipApi.

Since

1.0.0

Throws

when a data group number is outside 1 to 16, or the selection is empty.

Constructors

Link copied to clipboard
constructor(accessKey: ChipAccessKey, dataGroups: Set<Int> = setOf(1, 2), trustAnchors: List<TrustAnchor> = emptyList(), checkTime: Instant? = null, allowExtendedLength: Boolean = true, signerCertificate: DocumentSignerCertificate? = null, allowCheckDigitMismatch: Boolean = false, printedDocument: MrzDocument? = null)

Types

Link copied to clipboard

Builds ChipReadOptions step by step, with the constructor's defaults.

Properties

Link copied to clipboard

The key that opens the chip: MRZ values or the card access number. ChipReader.read does not clear it; call ChipAccessKey.clear when your app no longer needs it. The high-level entry points clear it at the ending of the read.

Link copied to clipboard

Whether a read may use an MRZ key whose check digits do not match their fields (ChipAccessKey.Mrz.checkDigitFindings). With false, the default, such a read ends before any command is sent, with io.lightine.tessera.types.errors.ChipKeyCheckDigitMismatch: a value read or typed with a mistake would otherwise cost the chip an access attempt. Set it to true only for a document known to be printed with a wrong check digit. A card access number has no check digit.

Link copied to clipboard

Whether the reader may use extended-length APDUs. They are used only when this is true, the transport carries them and the chip states it accepts them.

Link copied to clipboard

With null (the default), the validity-period checks are reported as not run (CheckOutcome.NotRun with ChipCheckReason.NO_TIME_GIVEN) and ChipRead.dg1 is null; the raw DG1 is still read. Otherwise this is the time at which certificate validity is checked and DG1's dates are read. The SDK never reads a clock: give the time your app trusts.

Link copied to clipboard

The data groups to read, by number (1 to 16), at least one. EF.COM, EF.SOD, and DG14 and DG15 when the chip lists them, are always read: the checks need them. An empty selection is refused, because a read that asks for no data group is nearly always a mistake; ask for DG1 at least. DG3 and DG4 need terminal authentication, which the SDK does not run, so asking for them gives a io.lightine.tessera.types.errors.ChipAccessDenied entry in ChipRead.fileErrors.

Link copied to clipboard

The MRZ your app read from the printed page (by the camera or typed in), or null, the default. When it is given, the result holds one more check, ChipCheckKind.Dg1MatchesPrintedMrz, whose detail (ChipCheckDetail.PrintedMrzFields) says for each MRZ field whether the chip's DG1 shows the same characters, different ones, or the field cannot be compared. It holds no value, and it never corrects or prefers either side. Pass it yourself: no key builder sets it for you. The options keep the document until your app lets go of them; the SDK cannot wipe it as it wipes the key. A read with no DG1 reports the check as not run (ChipCheckReason.NO_CHIP_MRZ). This works with no checkTime.

Link copied to clipboard

A document signer certificate your app supplies for a chip whose EF.SOD carries none. It is used only when EF.SOD names no signer of its own, and the signature check then records ChipSignerOrigin.SUPPLIED_BY_APP.

Link copied to clipboard

The root certificates your app chose for the signer checks. The SDK never bundles or downloads any; with none, the root checks report that they did not run.

Functions

Link copied to clipboard
open override fun toString(): String

The data groups and counts, never the key.