lmssl

lmssl is a static executable bundling the OpenSSL 4.0.3 CLI and embedded openssl.cnf with an LMScript bytecode VM for X.509, PKI, TLS, and crypto scripting. It supports full OpenSSL subcommands, step-by-step TLS handshake tracing, AEAD and key primitives, and standard lmcode_std_v3 REST and CLI interfaces.

Quick reference

npm install -g @lmctl-ai/lmctl@latest
lmssl --version
lmssl version
lmssl --lmcode-schema
lmssl --lmcode-signatures
Interface or flagSignature or syntaxPurpose
CLI host bytecodelmssl [--dry-run] --lmcode prog.dslb [args...]Execute or dry-run compiled LMScript bytecode against the embedded lmssl schema.
CLI schema and signatureslmssl --lmcode-schema [--json] | --lmcode-signaturesPrint human-readable schema summary, raw schema JSON bytes, or all 360 canonical signatures.
Embedded OpenSSL 4.0.3 CLIlmssl version | req | x509 | s_client | enc | dgst ...Run any unmodified OpenSSL 4.0.3 command using the compiled-in default openssl.cnf.
context ssl: Ssl (crypto)ssl.digest(alg, data) | ssl.hmac(...) | ssl.pbkdf2(...) | ssl.seal(...) | ssl.open(...)Compute message digests, HMACs, PBKDF2 key derivations, and AES-GCM or ChaCha20-Poly1305 AEAD encryption.
Ssl / Key / Cert / Csrssl.gen_ec(curve) -> Key | ssl.new_cert(key, subj) -> Cert | ssl.new_csr(key, subj) -> CsrGenerate RSA/EC/Ed25519 keys, build and sign X.509 certificates and CSRs, and verify certificate chains.
context net: Net / TlsCtx / Tlsnet.connect(host, port) -> Conn | ctx.connect(conn, sni) -> Tls | ctx.accept(conn) -> TlsResolve DNS, open TCP connections or listeners, negotiate client/server TLS handshakes, and inspect cipher/group traces.
context fs: Fs / out: Outfs.write_private(path, pem) | out.line(msg) | out.warn(msg) | out.fail(msg)Read and write files (mode 0600 for private keys), emit diagnostic lines to stderr, or fail with exit code 4.
Standard REST and CLIRestGet..RestOptions, RestHandler, CliCommand, CliOptionExpose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli.
p = _lmcode_ cli="lmssl" install="github:lmctl-ai/lmssl@latest";
let ca_key = ssl.gen_ec("P-256");
let ca = ssl.new_cert(ca_key, "CN=Example Root CA").ca(true).valid_days(365).sign_self(ca_key, "SHA256");
let leaf_key = ssl.gen_ed25519();
let leaf = ssl.new_cert(leaf_key, "CN=*.example.test").san("DNS:*.example.test,DNS:example.test").valid_days(90).sign_with(ca, ca_key, "SHA256");
assert_eq(leaf.verify_with(ca), true);
assert_eq(leaf.matches_host("api.example.test"), true);

@"/cert/subject"
fn get_subject(x: RestExchange) -> void implements RestGet {
  x.json("{\"subject\":\"" + leaf.subject() + "\",\"ca\":" + (ca.is_ca() ? "true" : "false") + "}");
}
assert_eq(rest_cli(str_split("/cert/subject", " ")), "{\"subject\":\"CN=*.example.test\",\"ca\":true}");
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));

Documentation pages

Source repository and releases