Quick Start
Overview
This page walks through the first local SST run from a clean clone: generating example credentials/configs, starting one Java Auth, building the C examples, and running one C server plus one C client.
The source repository is iotauth/iotauth. In this guide, $ROOT means the top-level iotauth/ directory after cloning the repository.
This quick start uses the default generated example topology. See Architecture for the existing diagram of the Auth/entity layout.
Prerequisites
Install:
- OpenSSL 3.0 or newer;
- Java 11 or newer;
- Maven;
- Node.js and npm;
- CMake 3.19 or newer;
- a C compiler supported by CMake.
On Ubuntu:
sudo apt-get install openssl openjdk-17-jdk nodejs npm maven cmake
On macOS:
brew install openssl@3 openjdk node npm maven cmake
Clone the repository and initialize submodules:
git clone https://github.com/iotauth/iotauth.git
cd iotauth
git submodule update --init --recursive
1. Generate credentials, configs, and Auth databases
From $ROOT:
cd examples
./cleanAll.sh
./generateAll.sh
The default graph is examples/configs/default.graph. The generator installs required Node packages for config generation, creates credentials, creates entity configs, writes Auth properties, and builds Auth databases.
If you want to keep intermediate Auth DB config files after database generation, use:
./generateAll.sh -lc
2. Build Auth
Open a terminal from the repository root:
cd auth/auth-server
mvn clean install
Start Auth 101:
java -jar target/auth-server-jar-with-dependencies.jar -p ../properties/exampleAuth101.properties
Auth is ready when the prompt shows:
Enter command (e.g., show re/cp/ta/sk/maps/dp/di, add/remove re/cp/dp...):
Keep this terminal running.
3. Build the C example entities
Open a second terminal from the repository root:
cd entity/c/examples/server_client_example
mkdir -p build
cd build
cmake ../
make
4. Start the C server entity
In the second terminal:
./entity_server ../c_server.config
Keep this terminal running.
5. Start the C client entity
Open a third terminal from the C example build directory:
cd entity/c/examples/server_client_example/build
./entity_client ../c_client.config
The client config requests session keys from Auth 101 for the server group and connects to the server at the generated address and port.
What should happen
You should see:
- Auth accepting entity requests and issuing session keys;
- the server accepting a secure handshake;
- the client completing the secure communication setup;
- encrypted messages being sent and received by the C example code.
The exact log text can vary by build type and current source changes, but the important milestones are session key request, session-key handshake, and secure message transfer.
Next steps
After this first run:
- read Network Configuration to understand what
generateAll.shcreated; - read the C Guide if you are writing native entity code;
- read the Node.js Guide if you are writing gateway or JavaScript entities;
- read Server/Client Example for a complete C entity walkthrough;
- read File Block Encryption for offline block-level encryption.