Does anybody have any pointers as to how I could go about interacting with the Key/Certificate store using nodeJs? I specifically want to add/remove certificates and possibly keys.
Update.
So the way to go here is to use "edge". Very nice work!
Does anybody have any pointers as to how I could go about interacting with the Key/Certificate store using nodeJs? I specifically want to add/remove certificates and possibly keys.
Update.
So the way to go here is to use "edge". Very nice work!
Without knowing too much about your setup here is a stab at a 'pointer' as to how to interact.
You could try using Nodes Child Process and then spawning out a process to the commandline and interact with the key/certificate store the way you would via command line. Microsofts certificate manager tool perhaps?
Rough example:
var exec = require('child_process').exec,
child;
child = exec('certmgr /add /all /c myFile.ext newFile.ext',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
npmjs.org
doesn't look promising for a module. There's nothing in the base program that does this. –
Grammar I've just published node-windows-root-certs which uses ffi to read the windows root certificate store, and then apply these in nodejs... may provide some inspiration.
Example use to use Windows certificates rather than internal NodeJS certificates:
var windowsRootCerts = require('node-windows-root-certs');
// to read the windows root certs and patch in a single command:
windowsRootCerts.useWindowsCerts();
There is an npm package 'windows-certs' which uses edge and a .csx
script to read certificates in .pem
format
This should have the required functionality, but is marked as deprecated. The successor package is indicated as.win-ca
. However, this seems to be lacking some of the functionality of the older package:
The following code works for me.
// https://github.com/ukoloff/win-ca#inject
const ca = require('win-ca')
ca.inject('+')
© 2022 - 2024 — McMap. All rights reserved.