Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
Try Standalone Xedge PSA on Windows

Build Xedge with the supplied software PSA Crypto provider, sign a message with the ba.tpm Lua API, and confirm that keys and encrypted settings survive a restart. The development key store is created automatically. Hardware protection requires a target provider.

Use the Windows BAS SDK and Visual Studio with the C++ desktop tools installed. The SDK includes the provider and matching Lua resources. Open a Visual Studio Developer Command Prompt (CMD) and start in the BAS root.

1. Open or build the PSA project

Open examples/xedge/VcMake/xedge-psa.vcxproj in Visual Studio and build Debug x64, or run:

msbuild examples\xedge\VcMake\xedge-psa.vcxproj /t:Rebuild /m /p:Configuration=Debug /p:Platform=x64

The project builds its provider automatically. Keep PsaTestSimulator=true; no Makefile, provider properties, or manual root provisioning is needed. It also supports Release and Win32.

Using an SVN development checkout? First follow the development resource and version steps. Released SDK headers already contain the build revision.

2. Locate the executable

The result is examples/xedge/obj/VcMake/psa/x64/Debug/xedge-psa.exe, with its Lua resources embedded. Rebuild with the same command when needed. The supplied src/PsaSimInit.c implements xedgeInitPsa(); Xedge initializes the provider before cryptographic use and keeps it open across Lua debugger restarts.

3. Run and check persistence

Continue in the same command prompt:

rem Keep this test's configuration separate from other Xedge installations.
cd examples\xedge\obj\VcMake\psa\x64\Debug
if not exist home mkdir home
set "HOME=%CD%\home"
xedge-psa.exe
  1. Open http://127.0.0.1/rtl/. If port 80 is busy, use the HTTP port printed in the console, for example http://127.0.0.1:9357/rtl/.
  2. Open the three-dot menu, select Lua Shell, paste the signing example, and click Run. Expect Created signing key, PSA signing check passed, and a Public-key SHA-256 value. Record that fingerprint.
  3. Open SMTP Server from the same menu. Under Email Log, set Subject to PSA restart check. Then uncheck Enable to save the log settings. If already unchecked, check it and uncheck it again. Leave the SMTP server fields empty; this test sends no email.
  4. Stop Xedge with Ctrl+C and wait for the command prompt. Run xedge-psa.exe again from this directory with the same HOME setting. Refresh the browser.
  5. Run the signing example again. Confirm Reusing signing key, the identical fingerprint, and PSA signing check passed. Reopen SMTP Server and confirm that Subject is still PSA restart check and Enable is unchecked.

If the demonstration key already exists, both runs report that it is reused. The configuration is saved as encrypted home/xedge-psa/xcfg.bin.

Keep these files together

All paths below are relative to examples/xedge/obj/VcMake/psa/x64/Debug:

Path Purpose
psa-simulator/ Persistent roots and signing keys
psa-simulator.key Wrapping secret that protects the key records
home/xedge-psa/ Encrypted configuration and application files
Xedge-configuration-file Second encrypted configuration copy, written by the supplied led.c example

Retain these across restarts and rebuilds. Keep the same HOME when starting from a new command prompt. If storage is locked, stop the other process using this executable's store. Do not erase keys to fix a startup error.

For your target provider, follow the standalone build steps. Read How It Works for storage, root settings, and recovery details.