
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-keytool
Advanced tools
basic wrapper for the java keytool
First, require the library:
var Keytool = require('node-keytool');
Then, open / create your keystore file:
// Keytool(filename, storepass, options)
var store = Keytool('example.keystore', 'changeit', {debug: false, storetype: 'JCEKS'});
debug (boolean, if true all keytool output is piped to stdout/stderr)
storetype: keystore type (defaults to JKS, some actions require other storage types), executable (see below)
The library assumes that the keytool executable is on your PATH. In other cases, you can specify a path to the executable by passing the appropriate option:
var store = Keytool(filename, storepass, {executable: '/usr/bin/keytool'});
Most keytool actions are supported with their stdin input method or file-based operations. All operations expect a callback of the form function(err, result) as the last argument. See the manpage for keytool for more details.
Generated a certificate request for the given alias. If outfile is omitted or null, res.outdata will contain the certificate data.
Rename alias to destalias.
Export the given certificate to the output file filename.
If rfcoutput is true the result is output in RFC 1421 compliant base64 encoding. (Binary DER is the default)
Generates a keypair.
dname: Distinguished name, e.g. "CN=abc,OU=dev"
validity: Integer, Number of days this certificate should be valid
x509ext: String-Array, multiple extensions can be specified
startdate: JavaScript Date object
Generates a certificate from the request given as a) an input file (parameter infile) or b) as a string in-memory (parameter datain).
If the parameter outfile is omitted or null, the result object contains the certificate data.
If the parameter dname is specified, this will be used in favor of the distinguished name used to generate the request.
startdate: JavasScript Date object
Import a certificate from a file (parameter infile) or from a string (parameter datain).
trustcacerts: Boolean
Import a passphrase into the keystore.
Note: This operation is not supported by the default keystore type (JKS). Use JCEKS or similar if you need this.
Change the password for the given alias from keypass to newkeypass
Change the password for the keystore itself.
If rfcoutput is true, the callback will contain the BASE64 encoded representation of the certificate given in file (string, filename) or data (string).
If rfcoutput is false, basic certificate information will be parsed from the keytool output (signature algorithms, validity information, issuer / owner - where applicable).
Removes an alias completely
Read the content of the keystore. See examples/listcontent.js for an example on how to use the results.
Creates an empty keystore at the previously specified location. Fails if the targeted file already exists.
FAQs
wrapper for keytool binary
We found that node-keytool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.