Registration Client
Run on | nodes |
Program type | client |
Communicates with | Certificate Server, Registration Server |
Description | Program for nodes to request for registration with the control center. |
Flow description
The registration client constructs the registration request, then sends it to the server. It gets the created node’s ID and saves it locally.
- Connect to the certificate server. Send a 4-byte packet containing the certificate magic number.
- Read the response from the certificate server as the public encryption certificate.
- Generate the registration request.
- If there is valid persisted node information, use the stored node ID.
- Prompt the user for the network ID and network registration key.
- Randomly generate a 32-byte key to be used for AES encryption.
- Using the public certificate, encrypt the registration request.
- Connect to the registration server. Send the encrypted packet.
- Get the response from the server. Read the first two bytes as the status. If the status is not 200, print the error that follows.
- Otherwise, use the generated node encryption key and decrypt the packet as per the node encryption protocol. Save the 16 byte node ID in local non-volatile storage.
Schema description
See the certificate server and the registration server schema.