from

A key from a scanned or parsed MRZ, in one call: the document number, the date of birth and the date of expiry, each with its check digit, exactly as printed.

It works for TD1, TD2 and TD3. For a TD1 or TD2 document whose number is longer than nine characters it joins the number from the optional data, as fromPrintedFields does (Doc 9303 Part 11, section 9.7.3). Nothing is corrected: a check digit that does not match its field stays as printed and shows in checkDigitFindings, and the check-digit gate at read time still applies.

A scanner's decoded result holds a ParseResult; pass that to the other overload, or its document.

The key does not keep the document. To have the read compare the printed MRZ with the chip's DG1, pass the same document to ChipReadOptions.Builder.printedDocument yourself: the two calls are separate on purpose, so nothing is passed on that you did not choose.

Nothing is thrown for a document that lacks a field: the answer is MrzKeyResult.NotBuilt with the field and the problem. A visa has no chip (MrzKeyProblem.DOCUMENT_HAS_NO_CHIP).

Return

MrzKeyResult.Built with the key, or MrzKeyResult.NotBuilt.

Since

1.0.0

Parameters

document

The document from mrz-core's parser or the scanner.


A key from a parse result, as a scanner returns it (MrzScanResult.Decoded.parse): the same as from on the document of a success or a partial success.

Return

MrzKeyResult.Built, or MrzKeyResult.NotBuilt with MrzKeyProblem.NO_DOCUMENT when the parse failed and holds no document.

Since

1.0.0

Parameters

result

The parse result.