OpenSSL.js
OpenSSL for node and the browser.
A WebAssembly port ofApache 2.0
LICENSE:NOTE:
This is a source-code build of OpenSSL using the wasienv toolchain. The test suite is still under development. Until it is complete, the author makes no claims concerning accuracy or security. Use at your own risk.
Quick Start
ES6 Module (main)
;;;;; const __filename =
Installation
OpenSSL.js is available through npm
npm install openssl.js
Usage
The main export exposes the OpenSSL class; the constructor takes two arguments in an args object:
fs
: Use either the node builtin fs or an API compatible version like @wasmer/wasmfs (which uses memfs), or BrowserFSrootDir
: The path in the file system to map to the root (/
) of the OpenSSL.js instance to use for file IO
The instance exposes a single method, runCommand
, which accepts a string containing commands to be run against the OpenSSL command line interface.
Examples
CJS
const OpenSSL = ;const resolve = ;const fs = ; { let rootDir = ; let openSSL = fs rootDir ; let result1 = await openSSL; let result2 = await openSSL;};
Browser
;/** @wasmer/wasmfs */; const wasmFs = ; { let openSSL = fs: wasmFsfs rootDir: "/" wasmBinaryPath: "../dist/openssl.wasm" ; let result1 = await openSSL; let pK = wasmFsfs; console; documentbodyinnerText = pK;};