C API for BALTECH SDK

§ brp_Desfire_VirtualCardSelect()

brp_errcode brp_Desfire_VirtualCardSelect ( brp_protocol  protocol,
bool  ForceVcsAuthentication,
bool  UseExtVcSelectKeys,
unsigned  DiversifyMacKey,
bool  DiversifyEncKey,
bool  UseVcSelectKeys,
brp_buf  IID,
size_t  IID_len,
unsigned  EncKeyIdx,
unsigned  MacKeyIdx,
brp_buf  DivData,
size_t  DivData_len,
brp_buf  EncKey,
size_t  EncKey_len,
brp_buf  MacKey,
size_t  MacKey_len,
unsigned *  FciType,
brp_buf Fci,
size_t *  Fci_len,
brp_mempool mempool 
)

This command selects a virtual card.

Parameters
[in]protocolused to execute the command
[in]ForceVcsAuthenticationForces authentication to a virtual card. A card without encryption returns BRP_Desfire_VcsAndProxCheckError
[in]UseExtVcSelectKeysAuthenticates to a virtual card. A MAC and a encryption key has to be specified. Use (external) Virtual Card keys given as command parameter.
[in]DiversifyMacKeyDiversifies VC Mac key. Remarks for use of divinput: VC-UID is obtained by decryption of the card response. If VC-UID is concatenated with divinput the input wil be limited to 31 bytes.
[in]DiversifyEncKeyDiversifies VC Encryption key
[in]UseVcSelectKeysAuthenticates to a virtual card. A MAC and a encryption key has to be specified. Use Keys stored in CryptoMemory or SAM.
[in]IIDVirtual Card Identifier.
[in]IID_len
[in]EncKeyIdxCrypto Memory Index (SAM or CryptoMemory) of virtual card select key * SAM: MSByte: Key version / LSByte: KeyIdx * Crypto Memory: MSByte: Page (0..15) / LSByte: KeyIdx (0x80-0xBF)
[in]MacKeyIdxCrypto Memory Index (SAM or CryptoMemory) of MAC key * SAM: MSByte: Key version / LSByte: KeyIdx * Crypto Memory: MSByte: Page (0..15) / LSByte: KeyIdx (0x80-0xBF)
[in]DivDataKey diversification according to NXP AN10922.
[in]DivData_len
[in]EncKeyVC encryption key
[in]EncKey_len
[in]MacKeyVC MAC key
[in]MacKey_len
[out]FciType0: raw data 1: uid_len(1) and card type(1) 2: uid_len(1), card type(1) and memory size(1)
[out]FciFile control information
[out]Fci_len
[in]mempoolis used to store response data. Maybe NULL to use an internal mempool, in this case the data is only available until another command uses the internal mempool