Access Restricted

This page contains internal documentation that is not publicly available.


Project / LegicKeySettings / Index Value

Each entry corresponds to a slot in the key storage of the LEGIC reader chip (SM4x00/SM6300). The value index is the key storage index.

The first part of the entry (KeyType, KeyDerivation, DivIdx) describes the key stored in this slot. The second part (starting with VcpContext) defines which key of which VCP file in Project/LegicVcp/VcpData is transferred into this slot.

A VCP label is not necessarily unique: VCP files conforming to the LEGIC Orbit Configuration Standard (LOCS) use the same label for keys of different credential types (e.g. label 0x0000 for key K0 of Google Wallet as well as for key K0 of Apple Wallet), and different VCP files may use the same labels. Thus a key is identified by the VCP file (VcpId), its VCP label and, for LOCS, its credential context.

Example for a LOCS VCP file with VcpId 0x1A2B3C4D that contains keys for Google Wallet (credential type 0x0001) and Apple Wallet (credential type 0x0002), both with population index 0:

  • Google Wallet, key K0 (label 0x0000): VcpContext = LocsCredential, VcpId = 0x1A2B3C4D, VcpLabel = 0x0000, CredentialType = 0x0001, PopulationIndex = 0
  • Apple Wallet, key K0 (label 0x0000): as above, but CredentialType = 0x0002
  • Apple Wallet, key K1 (label 0x0100): VcpLabel = 0x0100, CredentialType = 0x0002

Properties

  • Value ID: 0x0844/0x00 - 0x7F

Format

Name Type/Size Description
KeyType Enumeration (8 bits) Crypto algorithm of the key stored in this slot
Values (6):
  • DES (0x01)
    Key length: 8 bytes
  • TripleDES (0x02)
    Key length: 16 bytes
  • ThreeKeyTripleDES (0x03)
    Key length: 24 bytes (occupies two consecutive slots)
  • AES128 (0x04)
    Key length: 16 bytes
  • AES256 (0x05)
    Key length: 32 bytes (occupies two consecutive slots)
  • MifareClassic (0x06)
    MIFARE Crypto1 key A and key B (6 bytes each) in one slot
KeyDerivation Enumeration (8 bits) Key derivation method of the key stored in this slot.
Values (6):
  • None (0x00)
    No key derivation
  • Legic (0x01)
    LEGIC key derivation
  • NxpSamAV1 (0x02)
    NXP SAM AV1 compatible key derivation
  • LegicNeon (0x05)
    LEGIC neon file authentication/encryption
  • LcMessage (0x06)
    LC_MESSAGE encryption
  • NxpSamAV3 (0x07)
    NXP SAM AV2/AV3 compatible key derivation
DivIdx Integer (8 bits) Reference to diversification data description:
VcpContext Enumeration (8 bits) Defines how this slot is assigned to a key of a VCP file. If this field is missing, the firmware handles the entry like VcpContext = None.
Values (3):
  • None (0x00)
    The slot is not filled from a VCP file (e.g. the key is stored in another way and only its diversification settings are required).
  • Label (0x01)
    The key is identified by VcpId and VcpLabel. This applies only to keys outside a LOCS credential context, i.e. to keys of VCP files that do not conform to LOCS, or to keys in the LOCS context before the first credential context. Keys inside a LOCS credential context never match, since their labels are not unique.
  • LocsCredential (0x02)
    The key is identified by VcpId, VcpLabel and the LOCS credential context (CredentialType and PopulationIndex) it is defined in.
Optional field, condition: (VcpContext == VcpContext.Label) or (VcpContext == VcpContext.LocsCredential)
VcpId Integer (32 bits) Identifier of the VCP file containing the key; has to match the VcpId in the header of the VCP file in Project/LegicVcp/VcpData.
VcpLabel Integer (16 bits) VCP label of the key. For LOCS VCP files the label consists of the key number (high byte: 0x00...0x0F for K0...K15) and the key lifecycle (low byte: 0x00 for L1, 0x01 for L2).
Optional field, condition: VcpContext == VcpContext.LocsCredential
CredentialType Enumeration (16 bits) LOCS credential type of the credential context the key is defined in
Values (2):
  • GoogleWallet (0x0001)
    Google Wallet (T1)
  • AppleWallet (0x0002)
    Apple Wallet (T2)
PopulationIndex Integer (8 bits) LOCS population index (0...63 for N0...N63) of the credential context the key is defined in