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

SST exposes the same core ideas through different entity APIs, but the language support is not identical. Use this map to choose the right API surface and to translate concepts between C and Node.js.

Main secure communication capabilities

ResponsibilityC APINode.js API
Load generated configinit_SST()new SecureCommClient(config), new SecureCommServer(config)
Initialize runtime stateinit_SST()initialize()
Request session keysget_session_key()getSessionKeysForCaching(n) or implicit via provideInput('serverHostPort', ...)
Client secure handshakesecure_connect_to_server()provideInput('serverHostPort', {host, port})
Server secure handshakeserver_secure_comm_setup()initialize() plus setOutputHandler('received', ...)
Send encrypted datasend_secure_message()provideInput('toSend', Buffer)
Receive decrypted dataread_secure_message()setOutputHandler('received', handler)
Threaded receive loopreceive_thread_read_one_each() with pthread_createNot needed — Node.js is event-driven
Encrypt/decrypt buffers without socketencrypt_buf_with_session_key(), _without_malloc variantsNo direct equivalent
Cache session keyssession_key_list_t + get_session_key()getSessionKeysForCaching() / getSessionKeysForFutureClients()
Persist session keys to disksave_session_key_list(), _with_password variantsNot documented
Free runtime resourcesfree_session_ctx(), free_session_key_list_t(), free_SST_ctx_t()JavaScript garbage collection; close connections via provideInput

Configuration capabilities

ResponsibilitySource
Define Auths and entities.graph file
Generate credentialsexamples/credentialGenerator.js via generateAll.sh
Generate Auth propertiesexamples/authConfigGenerator.js via generateAll.sh
Generate Auth databasesexamples/authDBGenerator.js via generateAll.sh
Generate Node.js configsexamples/entityConfigGenerator.js via generateAll.sh
Generate C example configsgenerateAll.sh and C example fixtures

Advanced capability support

CapabilityCNode.js
Direct secure client/server communicationYesYes
Publisher/subscriber accessorsNot a primary pathYes (SecurePublisher, SecureSubscriber)
Delegation and privilege operationsNot a primary pathYes (performPrivilege, getSessionKeyIdForGrantAccess)
Migration to backup AuthNot a primary pathYes (migrateToTrustedAuth, migrationEnabled parameter)
Per-resource session key requestsNot a primary pathYes (provideInputResource)
Block-based file encryptionYes (examples/file_block_encrypt_example/)No direct equivalent
IPFS file encryption/upload/downloadYes (include/ipfs.h, examples/ipfs_examples/)No direct equivalent
Session key persistence to diskYes (save_session_key_list, load_session_key_list)Not documented
Password-protected key storageYes (save/load_session_key_list_with_password)Not 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 the .graph file and generateAll.sh to generate all credentials, configs, and databases rather than hand-writing them.