We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
GuidesWallet KitAppendixPass Reader DevelopmentReading Private Data from the Target App After Authentication

Reading Private Data from the Target App After Authentication

Before reading data from a pass, the pass reader needs to be authenticated by the pass. The pass reader uses the card_key of the target pass to encrypt the random number generated by the applet in AES 128 CBC mode. The applet decrypts and verifies the random number.

  1. Generate a 16-byte AES IV and write it to the EF10 file.
    Select the EF10 file.
    Collapse
    Word wrap
    Dark theme
    Copy code
    1. 00A4000002EF10

    Write the AES IV to the EF10 file in LV format, where L indicates the length and V indicates the value. For example, the IV FF6A7D01AC09C16198844D8FE15102CF is written to the file as 10FF6A7D01AC09C16198844D8FE15102CF.

    Collapse
    Word wrap
    Dark theme
    Copy code
    1. 00D600001110FF6A7D01AC09C16198844D8FE15102CF
  2. Read the 16-byte random number generated by the applet.
    Collapse
    Word wrap
    Dark theme
    Copy code
    1. 0084000010

    Encrypt the random number in AES/CBC/NoPadding mode using the card_key of the target pass. Define the encryption result as encryStr.

    NOTE

    The generation mode of card_key is user-defined. Ensure that the card_key used by the pass reader to encrypt the random number is the same as the card_key delivered by your server.

  3. Send the external authentication instruction in format of "0082000310"+encryStr.
    Collapse
    Word wrap
    Dark theme
    Copy code
    1. 00820003100B0740D3B02E6FD66FD25D5A1C362E3F resp : 9000

    If the operation is successful, 9000 is returned.

  4. Read personalized data from the pass.

    The following table describes the data.

    Expand

    Name

    Identifier

    File

    Maximum Length (Bytes)

    Function

    Pass certificate

    card_certificate

    EF01

    2048

    Pass certificate provided by the pass issuer.

    Pass ID

    card_id

    EF02

    128

    Unique ID of a pass provided by the pass issuer.

    Private pass information

    card_privateInfo

    EF03

    256

    Private information about a pass, for example, the validity period and permissions.

    The following is an example. If 9000 is returned, the operation is successful.
    Collapse
    Word wrap
    Dark theme
    Copy code
    1. // Select the EF01 file.
    2. 00A4000002EF01 resp : 9000
    3. // Read the EF01 file, which contains 2048 bytes at most.
    4. 00B00000FF resp : xxxxx
    5. 00B000FFFF resp : xxxxx
    6. 00B001FEFF resp : xxxxx
    7. 00B002FDFF resp : xxxxx
    8. 00B003FCFF resp : xxxxx
    9. 00B004FBFF resp : xxxxx
    10. 00B005FAFF resp : xxxxx
    11. 00B006F9FF resp : xxxxx
    12. 00B007F808 resp : xxxxx
    13. // Select the EF02 file.
    14. 00A4000002EF02 resp : 9000
    15. // Read the EF02 file, which contains 128 bytes at most.
    16. 00B0000080 resp : xxxxx
    17. // Select the EF03 file.
    18. 00A4000002EF03 resp : 9000
    19. // Read the EF03 file, which contains 256 bytes at most.
    20. 00B00000FF resp : xxxxx
    21. 00B000FF01 resp : xxxxx
Search in Guides
Enter a keyword.