npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ssl-public-key

v1.0.3

Published

CLI to fetch and manage SSL public keys

Readme

ssl-public-key

A command-line utility for extracting and managing public keys from SSL/TLS certificates. It retrieves the SPKI SHA256 fingerprint in base64 format, ideal for tasks like certificate pinning in secure applications.

Features

  • Fetch public key fingerprints for individual domains.
  • Manage profiles to group multiple domains for batch operations.
  • Simple profile management: add, update, remove domains and entire profiles.
  • Optional association of environment variables with domains in profiles.

Quick Start

Run npx ssl-public-key --help to see all available commands and options.

Commands and Options

Global Options

  • -v, --version: Displays the current version.
  • -h, --help: Shows help information.

Default Command

The default command is get-public-key <domain>.

Available Commands

|Command|Description|Arguments|Options| |:---|:---|:---|:---| |get-public-key <domain>|Retrieve the public key for a specific domain.|<domain>: The domain name (e.g., example.com).|None| |get [options] <profile>|Fetches public keys for all domains in the specified profile.|<profile>: Profile name.|--env:Specify the output format (json or env) (default: false)| |list-profiles|Lists all existing profiles.|None|None| |remove-profile <profile>|Deletes the entire profile.|<profile>: Profile name.|None| |set <profile> <domain> [envVar]|Adds or updates a domain in the profile, optionally with an environment variable name.|<profile>: Profile name.<domain>: Domain to add.[envVar]: Optional env var (e.g., API_KEY).|None| |remove <profile> <domain>|Removes a specific domain from the profile.|<profile>:Profile name.<domain>:Domain to remove.|None| |help [command]| Displays help for a specific command.| [command]: Optional command name.|None|

Profiles are stored locally and allow grouping domains for efficient management and batch fetching.

Usage Examples

Fetching a Single Domain's Public Key

npx ssl-public-key google.com

Or

npx ssl-public-key get-public-key google.com

Output: A base64-encoded SHA256 fingerprint.

Managing Profiles

Create a profile with a domain:

npx ssl-public-key set example-profile google.com API_CERT

Fetch all keys in the profile:

npx ssl-public-key get example-profile

List profiles:

npx ssl-public-key list-profiles

Update a domain's environment variable name:

npx ssl-public-key set example-profile google.com API_CERT_GOOGLE

Remove a domain:

npx ssl-public-key remove example-profile google.com

Delete the profile:

npx ssl-public-key remove-profile example-profile

How it works?

The tool connects to the domain over TLS, extracts the certificate's public key, computes the SHA256 hash of the Subject Public Key Info (SPKI), and encodes it in base64. Profiles are stored in a local JSON file for easy access.

Development

The project is written in TypeScript. To contribute:

  • Fork the repo.
  • Create a feature branch.
  • Commit changes.
  • Push and open a PR.

License

MIT License.

Issues and Support

Report bugs or suggest features via GitHub issues