1. Introduction
For maximizing security, ZigBee 3.0 provides Install Code process to create link key known as Install Code Link Key.
2. Definitions
Link Key: is unique between each pair of nodes and are used to encrypt/decrypt the communication between the nodes.
Trust Center: usually is a ZigBee coordinator. It handles security of the network.
3. Install Code Link Key Format
Install code is made up of 6,8, 12 or 16 bytes random, hexadecimal number with 2 bytes CRC. The CRC should be appended to the installation code in little endian format. ZigBee 3.0 Base Device Behavior Specification requires the use of 16-byte Install Code.
4. Trust center behavior
The trust center should decide whether a joining node shall use the default link key or an Install Code Link Key depending on the value of bdbJoinUsesInstallCodeKey.
If bdbJoinUsesInstallCodeKey is FALSE, the Trust Center permits a node to join its network without having a corresponding install code link key. If bdbJoinUsesInstallCodeKey is TRUE, the Trust Center only permits a node to join its network if a corresponding install code link key associated with the node has been preinstalled before the node joins. The Trust Center shall add an entry into its Link Key Table based on ZED EUI64 address.
5. Trust Center (ZC) API
/* Attempt to join a ZigBee network */
ZbStartupConfigGetProDefaults(&config);
/* Set the centralized network */
APP_DBG("Network config : APP_STARTUP_CENTRALIZED_COORDINATOR");
config.startupControl = ZbStartTypeForm;
/* Using the default HA preconfigured Link Key */
memcpy(config.security.preconfiguredLinkKey, sec_key_ha, ZB_SEC_KEYSIZE);
config.channelList.count = 1;
config.channelList.list[0].page = 0;
config.channelList.list[0].channelMask = 1 << CHANNEL; /*Channel in use */
/* Using ZbStartupWait (blocking) */
status = ZbStartupWait(zigbee_app_info.zb, &config);