KenyaIDCardModel

A class derived from IDCardModel containing details specific to the Kenya ID card document

Declaration

@objc final public class KenyaIDCardModel : IDCardModel {
    @objc final public var mrzLine1: String? { get }
    @objc final public var mrzLine2: String? { get }
    @objc final public var mrzLine3: String? { get }
    @objc final public var serialNumber: String? { get }
    @objc final public var serialNumberCheckDigit: Int { get }
    @objc final public var optionalData1: String? { get }
    @objc final public var optionalData2: String? { get }
    @objc final public var dateOfBirthCheckDigit: Int { get }
    @objc final public var dateOfExpiry: Date? { get }
    @objc final public var dateOfExpiryCheckDigit: Int { get }
    @objc final public var compositeCheckDigit: Int { get }
    
    override final public func encode(to encoder: Encoder) throws
}

Only relevant details are shown, boilerplate or standard Swift generated code is omitted

Summary

Public variables

Name

Type

Description

Data source

String?

The top MRZ line of the ID card document.

MRZ

String?

The middle MRZ line of the ID card document.

MRZ

String?

The bottom MRZ line of the ID card document.

MRZ

String?

The serial number of the subject as found on the ID card document.

MRZ

Int

The check digit for serialNumber.

MRZ

String?

Uncategorized data found on the ID card document.

MRZ

String?

Uncategorized data found on the ID card document.

MRZ

Int

The check digit for dateOfBirth.

MRZ

Date?

The date of expiry of the ID card document.

MRZ

Int

The check digit for dateOfExpiry.

MRZ

Int

The check digit for the entire MRZ.

MRZ

Public methods

Signature

Return Type

Description

Void

Encodes the model using the encoder provided. Used to convert the model to JSON.

Validation

The following validation and verification applies to this document:

Check digit validation

Value

Validation type

Serial number

Date of birth

Date of expiry

MRZ line 1 & 2 composite

Component verification

As explained in Validation & Verification the following fields are verified across the front and back components of the document.

Value

Source

Identity number

Front: OCR

Back: MRZ

Public variables

mrzLine1

@objc final public var mrzLine1: String? { get }

Example: "I<UTOD231458907<<<<<<<<<<<<<<<"

The top MRZ line of the ID card document.

mrzLine2

@objc final public var mrzLine2: String? { get }

Example: "7408122F1204159UTO<<<<<<<<<<<6"

The middle MRZ line of the ID card document.

mrzLine3

@objc final public var mrzLine3: String? { get }

Example: "ERIKSSON<<ANNA<MARIA<<<<<<<<<<"

The bottom MRZ line of the ID card document.

serialNumber

@objc final public var serialNumber: String? { get }

Example: "01020304"

The serial number of the subject as found on the ID card document.

serialNumberCheckDigit

@objc final public var serialNumberCheckDigit: Int { get }

Example: 2

The check digit for serialNumber.

optionalData1

@objc final public var optionalData1: String? { get }

Example: "A1B2C3D4"

Uncategorized data found on the ID card document.

optionalData2

@objc final public var optionalData2: String? { get }

Example: "A1B2C3D4"

Uncategorized data found on the ID card document.

dateOfBirthCheckDigit

@objc final public var dateOfBirthCheckDigit: Int { get }

Example: 2

The check digit for dateOfBirth.

dateOfExpiry

@objc final public var dateOfExpiry: Date? { get }

Example: 2025/01/01

The date of expiry of the ID card document.

dateOfExpiryCheckDigit

@objc final public var dateOfExpiryCheckDigit: Int { get }

Example: 9

The check digit for dateOfExpiry.

compositeCheckDigit

@objc final public var compositeCheckDigit: Int { get }

Example: 6

The check digit for the entire MRZ.

Public methods

encode(to encoder: Encoder)

override final public func encode(to encoder: Encoder) throws

This function also calls its super function

Encodes the model using the encoder provided. Used to convert the model to JSON.

See also

Last updated