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, 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, Node.js, and Python.

Main secure communication capabilities

ResponsibilityC APINode.js APIPython API
Load entity configinit_SST()new SecureCommClient(config), new SecureCommServer(config)IoTAuthContext.from_config(config)
Initialize runtime stateinit_SST()initialize()IoTAuthContext.from_config()
Request session keysget_session_key()getSessionKeysForCaching(n) or implicit via provideInput('serverHostPort', ...)ctx.request_session_keys()
Client secure handshakesecure_connect_to_server()provideInput('serverHostPort', {host, port})SecureClient.connect()
Server secure handshakeserver_secure_comm_setup()initialize() plus setOutputHandler('received', ...)SecureServer.serve_once()
Send encrypted datasend_secure_message()provideInput('toSend', Buffer)channel.send(payload)
Receive decrypted dataread_secure_message()setOutputHandler('received', handler)channel.recv()
Threaded receive loopreceive_thread_read_one_each() with pthread_createNot needed — Node.js is event-drivenNot needed — standard Python threads or async loops
Encrypt/decrypt buffers without socketencrypt_buf_with_session_key(), _without_malloc variantsNo direct equivalentCrypto.encrypt_payload() / Crypto.decrypt_payload()
Cache session keyssession_key_list_t + get_session_key()getSessionKeysForCaching() / getSessionKeysForFutureClients()Internal SessionKeyCache inside IoTAuthContext
Persist session keys to disksave_session_key_list(), _with_password variantsNot documentedNot documented / runtime-oriented
Free runtime resourcesfree_session_ctx(), free_session_key_list_t(), free_SST_ctx_t()JavaScript 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 example configsChecked-in properties fixtures under the C example directories.

Advanced capability support

CapabilityCNode.jsPython
Direct secure client/server communicationYesYesYes (SecureClient, SecureServer)
Publisher/subscriber accessorsNot a primary pathYes (SecurePublisher, SecureSubscriber)No direct equivalent
Delegation and privilege operationsNot a primary pathYes (performPrivilege, getSessionKeyIdForGrantAccess)Not currently documented
Migration to backup AuthNot a primary pathYes (migrateToTrustedAuth, migrationEnabled parameter)Not currently documented
Per-resource session key requestsNot a primary pathYes (provideInputResource)Not currently documented
Block-based file encryptionYes (examples/file_block_encrypt_example/)No direct equivalentNo direct equivalent
IPFS file encryption/upload/downloadYes (include/ipfs.h, examples/ipfs_examples/)No direct equivalentFile System Manager / File Sharing examples
Session key persistence to diskYes (save_session_key_list, load_session_key_list)Not documentedNot documented
Password-protected key storageYes (save/load_session_key_list_with_password)Not 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 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.