Skip to content

Establish an AES-authenticated and encrypted connection

To establish an AES-authenticated and encrypted connection run the following commands in your protocol stack before connecting to the reader with brp_open():

int security_level = 1; // (1)
brp_sec_key key = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, }; // (2)
int security_mode = BRP_SECMODE_STD; // (3)
errcode = brp_set_crypto(dev, brp_create_secure_channel(security_level, key, security_mode)); // (4)
  1. A security level defines a set of permissions for the host application. Specify the number of the security level (1, 2, or 3) as defined in the reader configuration.
  2. The AES encryption key for the security level, as defined in the reader configuration
  3. We recommend the default value BRP_SECMODE_STD.
  4. brp_create_secure_channel() creates an AES-authenticated and encrypted channel. Pass it to brp_set_crypto() to assign the crypto protocol object to your protocol stack.

Try it out with our app note

The app note appnotes\secure_communication in the SDK gives you a working example of the implementation (learn more about app notes).

Title