Now I'm looking for a way to integrate OpenSSL and Node.js.
My goals:
- I want to be platform independent, so the solution should work on OS X, Linux, and Windows.
- I want to avoid unnecessary disk operations. For example, the private key may not be in the file, but in the database (maybe this is a stupid example, but consider this a valid requirement).
- I want to support the creation of keys, csrs, sign csrs, create ca certificates, ... all certificate materials, from end to end.
Now the options that I have reviewed are as follows:
- Use the OpenSSL library, which is integrated into Node.js. Unfortunately, the crypto module does not provide certificate information.
- Use the OpenSSL library with an external module. Unfortunately, I don't know how to do this, possibly due to a lack of knowledge in C / C ++.
- Use the OpenSSL binary as a child process. Given that OpenSSL is available, this should work on all platforms. This is not nice, but it works.
Question No. 1: As I already wrote, I have no idea how to directly access the OpenSSL library, which comes bundled with Node.js. How do I approach this?
I am currently using the binary as a child process. Unfortunately, this requires that all such things as private keys, etc., are either specified as files (which I clearly want to avoid), or I transfer everything using / dev / stdin (which does not work on Windows).
Question # 2: How can I handle this? Will solution # 1 solve this problem too?
source share