How to read the biometric response from packet manager?

Once registration of a resident is performed on the field the biometric data collected is stored as a CBEFF file in the packet which is further sent to the server for processing. When the packet reaches the packet store (blob storage to store the packet - we use minIO as our default packet store), the biometric data can be fetched using the packet manager APIs.

The response of the packet manager is in JSON. In this document, we will be showing how you can read the JSON data.

Sample response

{ "id": "mosip.registration.packet.reader", "version": "v1", "responsetime": "2021-08-10T06:17:42.269Z", "metadata": null, "response": { "version": null, "cbeffversion": null, "birInfo": null, "segments": [ { "version": { "major": 1, "minor": 1 }, "cbeffversion": { "major": 1, "minor": 1 }, "birInfo": { "creator": null, "index": null, "payload": null, "integrity": true, "creationDate": null, "notValidBefore": null, "notValidAfter": null }, "bdbInfo": { "challengeResponse": null, "index": null, "encryption": null, "creationDate": "2021-05-05T09:37:05.6118559", "notValidBefore": null, "notValidAfter": null, "type": [ "IRIS" ], "subtype": [ "Left" ], "level": "RAW", "product": null, "purpose": "ENROLL", "quality": { "algorithm": { "organization": "HMAC", "type": "SHA-256" }, "score": 81, "qualityCalculationFailed": null }, "format": { "organization": "Mosip", "type": "9" }, "captureDevice": null, "featureExtractionAlgorithm": null, "comparisonAlgorithm": null, "compressionAlgorithm": null }, "bdb": "<base64URL encoded ISO Image>", "sb": null, "sbInfo": null, "others": null } ] }, "errors": [] }

 

  • This response has only one segment, i.e. the Left Iris. A whole response will have a total of 13 biometric segments i.e. two Iris, ten fingers and one face.

  • In each segment, we first have the meta-information related to the biometric captured. Here you can see the type and subtype is IRIS and Left whereas the quality score is 81.

  • In the end, we have a variable called bdb which contains the biometric data. This biometric data is base64URL encoded and is in form of an ISO image.

  • In order to view this image,

    • First, you need to decode the data

    • Convert the ISO image to JPEG2000

  • The JPEG2000 images are readable in some of the browsers but you can also choose to convert the image to PNG or JPG form JPEG2000 using some utility

Please note that for decoding and converting ISO images to JPEG2000, sample code is available in our print service.