
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@cto.af/ca
Advanced tools
Testing-only Certificate Authority (CA) for your local development environment ONLY. This is in no way suitable for production of any kind.
Testing-only Certificate Authority (CA) for your local development environment ONLY. This is in no way suitable for production of any kind.
This package will automatically create new keypairs as needed, with the CA cert lasting a year by default and the leaf certs 3 days by default.
Currently, there is NO SECURITY for the private keys. These should be stored in an OS-specific keychain one day.
npm install @cto.af/ca
Full API documentation is available.
Example:
import {createCert} from '@cto.af/ca';
import {createServer} from 'node:tls';
// This reads and writes files from a user-scoped config directory for
// the CA cert and cwd()/.cert for the certificate.
const {key, cert} = await createCert({
  host: 'foo.local', // Default: 'localhost'
});
const server = createServer({key, cert}, () => {
  // Handle connection
});
A rudimentary CLI is provided.
Usage: cto-af-ca [options] [command]
Options:
  -d,--dir <DIRECTORY>  Directory for CA certs (default:
                        "[User config directory]/@cto.af/ca-nodejs")
  -h, --help            display help for command
  -q,--quiet            Less verbose
  -v,--verbose          More verbose
Commands:
  cert [options]        Create a cert signed by the CA
  create [options]      Create a CA certificate
  dir                   Show directory for certs
  list                  List exising certs by subject
  rm <SUBJECT>          Remove a CA cert by subject
  help [command]        display help for command
FAQs
Testing-only Certificate Authority (CA) for your local development environment ONLY. This is in no way suitable for production of any kind.
We found that @cto.af/ca demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.