idpass-lite icon indicating copy to clipboard operation
idpass-lite copied to clipboard

Python wrap

Open typelogic opened this issue 2 years ago • 0 comments

Issue

Most of these changes are the addition of python files to wrap libidpasslite.so in python. There is an addition of one new function idpass_lite_qrcodesvg in idpass.h header file. The outputting in SVG format directly in libidpasslite.so solves a lot of problems as the SVG is a universally portable, and visually scalable format. The python wrapping is also further malleable and currently it almost look the same in the Java JNI wrapping, having class definitions Reader and Card.

In summary, the overall flow is:

johnsmith.json --> pythonwrapping --> qrcode.svg

where, the johnsmith.json is a json file containing identity details of a person, and the output is a qrcode.svg SVG format.

To see it in action, checkout the repo then:

  • cd python-wrap
  • ./run.sh
  • Then view the generated qrcode1.svg or qrcode2.svg in a browser
  • Scan the generated QR code using "Android ID PASS Smartscanner" (install from GooglePlay)
  • Edit ident1.json or create a new ident3.json then generate its QR code.
  • Notice in the ident json file the pin code field. You will enter it in the Smartscanner app to decode more identity fields.
  • Tinker on the IOCTL_SET_ACL in IDPassNative.py to control which fields are visible by default without need for pin authentication.
  • The privExtra fields in the identity json always requires pin authentication in order for this field's value to be visible
  • The pubExtra fields in the identity is visible by default without need for pin authentication.

typelogic avatar Jun 02 '22 14:06 typelogic