@li0ard/ssh
v0.1.0
Published
SSH keys toolkit
Readme
Installation
# from NPM
npm i @li0ard/ssh
# from JSR
bunx jsr i @li0ard/sshFeatures
- Provides simple and modern API
- Most of the APIs are strictly typed
- Supports Bun, Node.js, Deno, Browsers
- Works with ED25519 and ECDSA keys (including password-encrypted keys)
- Supports conversion to Age format
Examples
import { PrivateKey, PublicKey } from "@li0ard/ssh";
const privateKey = PrivateKey.parse("-----BEGIN OPENSSH PRIVATE KEY...", "yourcoolpasshprase");
const publicKey = PublicKey.parse("ssh-ed25519...");
const data = new Uint8Array([0xAA, 0xBB, 0xCC, 0xDD]);
const signature = privateKey.sign(data);
console.log(signature); // -> Uint8Array [...]
console.log(publicKey.verify(data, signature)); // -> trueAcknowledgements
- @peculiar/ssh - Original implementation and inspiration
