Skip to main content

Entity Capabilities

Overview​

This page compares SST capabilities across the entity APIs so you can choose the right implementation path and translate concepts between C, C++, Node.js, and Python.

SST exposes the same core ideas through different entity APIs, but the language support and design paradigms vary across platforms. Use this map to choose the right API surface and to translate concepts between C, C++, Node.js, and Python.

Main secure communication capabilities​

ResponsibilityC APIC++ APINode.js APIPython API
Load entity configinit_SST()SST_API(config_path)new SecureCommClient(config), new SecureCommServer(config)IoTAuthContext.from_config(config)
Initialize runtime stateinit_SST()SST_API(config_path)initialize()IoTAuthContext.from_config()
Request session keysget_session_key()SST_API::get_session_key()getSessionKeysForCaching(n) or implicit via provideInput('serverHostPort', ...)ctx.request_session_keys()
Client secure handshakesecure_connect_to_server()SST_API::secure_connect_to_server()provideInput('serverHostPort', {host, port})SecureClient.connect()
Server secure handshakeserver_secure_comm_setup()SST_API::server_secure_comm_setup()initialize() plus setOutputHandler('received', ...)SecureServer.serve_once()
Send encrypted datasend_secure_message()SST_Session::send_secure_message()provideInput('toSend', Buffer)channel.send(payload)
Receive decrypted dataread_secure_message()SST_Session::read_secure_message()setOutputHandler('received', handler)channel.recv()
Threaded receive loopreceive_thread_read_one_each() with pthread_createSST_Session::receive_loop() in an application-owned threadNot needed — Node.js is event-drivenSynchronous channel.recv(); application-managed threads if needed
Encrypt/decrypt buffers without socketencrypt_buf_with_session_key(), _without_malloc variantsSST_API::encrypt/decrypt_buf_with_session_key()No direct equivalentsymmetric_encrypt_authenticate() / symmetric_decrypt_authenticate() in iotauth.crypto
Cache session keyssession_key_list_t + get_session_key()SessionKeyListgetSessionKeysForCaching() / getSessionKeysForFutureClients()Internal SessionKeyCache inside IoTAuthContext
Persist session keys to disksave_session_key_list(), _with_password variantsNo public save/load APINot documentedNot documented / runtime-oriented
Free runtime resourcesclose() socket, then free_session_ctx(), free_session_key_list_t(), free_SST_ctx_t()RAII; shut down sessions and join receiver threads before destructionJavaScript garbage collection; close connections via provideInputContext managers (with SecureClient(ctx):, channel.close())

Repository example configuration tooling​

ResponsibilitySource
Define example Auths and entities.graph file
Generate example credentialsexamples/credentialGenerator.js via generateAll.sh
Generate example Auth propertiesexamples/authConfigGenerator.js via generateAll.sh
Generate example Auth databasesexamples/authDBGenerator.js via generateAll.sh
Generate Node.js example configsexamples/entityConfigGenerator.js via generateAll.sh
Provide Python example configsNo dedicated generator. Use the checked-in Python properties fixtures, adapt a C properties fixture, or use a generated Node JSON config.
Provide C/C++ example configsChecked-in properties fixtures under the C example directories; C++ examples reuse them.

Advanced capability support​

CapabilityCC++Node.jsPython
Direct secure client/server communicationYesYes (SST_API, SST_Session)YesYes (SecureClient, SecureServer)
Publisher/subscriber accessorsNot a primary pathNo direct equivalentYes (SecurePublisher, SecureSubscriber)No direct equivalent
Delegation and privilege operationsNot a primary pathNo direct equivalentYes (performPrivilege, getSessionKeyIdForGrantAccess)Not currently documented
Migration to backup AuthNot a primary pathNo direct equivalentYes (migrateToTrustedAuth, migrationEnabled parameter)Not currently documented
Per-resource session key requestsNot a primary pathNo dedicated accessorYes (provideInputResource)Not currently documented
Block-based file encryptionYes (examples/file_block_encrypt_example/)Yes (cpp/examples/file_block_encrypt_example/)No direct equivalentNo direct equivalent
IPFS file encryption/upload/downloadYes (src/ipfs.h, examples/ipfs_examples/)Yes (sst::ipfs, cpp/examples/ipfs_examples/)No direct equivalentSecure File System Manager in examples/file_sharing/; no IPFS client helpers in the package
Session key persistence to diskYes (save_session_key_list, load_session_key_list)No public save/load APINot documentedNot documented
Password-protected key storageYes (save/load_session_key_list_with_password)No public save/load APINot documentedNot documented

Practical guidance​

  • Use C when building embedded or native entities, when you need explicit socket and memory control, or when you need file and IPFS encryption capabilities. Source: sst-c-api.
  • Use C++ for native C++17 entities with automatic resource cleanup, session classes, and IPFS helpers. See the C++ Guide.
  • Use Node.js when building gateways, scripts, demonstrations, or services where event callbacks are natural; or when you need publish/subscribe, delegation, or automatic Auth migration. Source: entity/node/ in iotauth/iotauth.
  • Use Python when building servers, clients, scripts, or services using modern object-oriented Python wrappers (SecureClient, SecureServer, and IoTAuthContext), or for File System Manager workflows. Source: entity/python/ in iotauth/iotauth.
  • For the repository examples, use the .graph file and generateAll.sh to generate credentials, Auth configuration, Auth databases, and Node entity configs.
  • For the repository Python examples, choose a checked-in or adapted properties config or a generated Node JSON config, then verify its credential paths.