I'm trying to replicate the following operation in Node.js without spawning the OpenSSL command, bc that would require me to write files to disk. I already have the private key, the certificate and the file to be signed in memory, and I'm looking to get the signed file content as a buffer or string. I have been looking around but couldn't find anything suitable. Does anyone know about a proper solution? Thanks in advance!
openssl smime -sign -signer file.crt -inkey file.pem -in file.xml -out file.xml.cms -outform PEM -nodetach