I have a certain need to generate them on the fly. While I guess I could use openssl commands to generate files, then read them and delete them, it would be nice if there was a way to do it inside of node.js.
Any suggestions? I checked out certgen but it doesn't have what I'm looking for (plus, it is just calling command line commands and generating files...).
I had the same demand.
If you know C++ you can write a module to link against OpenSSL directly.
If not (like me) then you're essentially stuck to CLI calls.
PS: I'd definitely avoid writing code to do certificate generation on my own. For highly security related code IMHO it's always better to re-use a trusted and well-established product such as OpenSSL.
You can use Forge to generate PKCS#12 files in node.js: