
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
keypairs-cli
Advanced tools
The most useful and easy-to-use crypto cli on the planet
(because openssl
is confusing).
You must have node.js installed.
npm install --global keypairs-cli
Guess and check.
The keypairs CLI is pretty fuzzy. If you just type at it, it'll probably work.
That said, the fuzzy behavior is not API-stable and is subject to change, so you should only script to the documented syntax. ;)
keypairs gen
keypairs ./priv.pem
keypairs sign ./priv.pem https://example.com/ '{"sub":"jon@example.com"}'
keypairs verify 'xxxxx.yyyyy.zzzzz'
keypairs decode 'xxxxx.yyyyy.zzzzz'
debug
such as keypairs debug gen pem key.pem jwk pub.json
No arguments - generates a universally compatible key of more-than-sufficient entropy.
keypairs gen
Generate an ecdsa key:
keypairs gen ec P-256
Generate an RSA key:
keypairs gen rsa 2048
keypairs ./priv.pem
keypairs '{"kty":"EC",...}'
keypairs ./priv.jwk.json
Syntax: keypairs <in> [priv-out opts...] [pub-out opts...]
keypairs <inkey> [[encoding|scheme] [priv-out]] [[encoding|scheme] [pub-out]] [public|private]
Note: If you specify a private and a public key, and you want to specify the schema/encoding of the public key, you must also specify the scheme and encoding of the public key. Order matters. Private keys come first.
JWK Keypair to PEM-encoded Private and Public keys:
keypairs ./priv.json pem pkcs1 ./priv.pem pem spki ./pub.pem
keypairs ./priv.json pem ./priv.pem ssh ./pub.json
keypairs ./priv.json pkcs8 ./priv.pem spki ./pub.json
PEM Keypair to JSON-encoded JWK (Public Key Only):
keypairs ./priv.pem jwk ./priv.pem public
keypairs ./priv.pem json ./priv.pem public
Generic PEM to JWK:
keypairs priv.pem priv.jwk.json
keypairs priv.pem priv.jwk.json pub.jwk.json
keypairs priv.pem pub.jwk.json public
# fails if the input is public
keypairs priv.pem priv.jwk.json private
Generic JWK to PEM:
keypairs '{"kty":"EC",...}' priv.pem
keypairs priv.json priv.pem
Syntax:
keypairs [key] sign [issuer url] <claims> [exp] [nbf]
Note: The issuer url can be omitted if it's already included among the claims.
Example:
keypairs ./priv.pem sign https://example.com/ '{"sub":"jon@example.com"}' 1h -5m
keypairs '{"kty":"EC",...}' sign https://example.com/ '{"sub":"jon@example.com"}' 1h -5m
Verify a JWT based on its issuer
keypairs verify 'xxx.yyy.zzz'
FAQs
CLI for Keypairs.js
We found that keypairs-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.