kee-pair
v2.0.0
Published
Fast and secure keypair generation and signing for Node.js
Maintainers
Readme
kee-pair
A TypeScript library for generating, managing, signing, and verifying asymmetric key pairs.
📦 Installation
npm i kee-pair📖 Usage
import { KeePair } from 'kee-pair';
// Generate a new Secp256k1 key pair
const keyPair = KeePair.generate('secp256k1');
// Sign some data
const message = 'Hello, KeePair!';
const signature = keyPair.sign(message, 'sha256');
// Verify the signature
const isValid = keyPair.verify(message, signature, 'sha256');
console.log('Signature valid:', isValid);
// Restore key pair from an existing private key
const restored = KeePair.fromPrivateKey(keyPair.privateKey, 'secp256k1');
console.log(
'Public keys match:',
restored.publicKey.equals(keyPair.publicKey)
);📚 Documentation
For all configuration options, please see the API docs.
🤝 Contributing
Want to contribute? Awesome! To show your support is to star the project, or to raise issues on GitHub.
Thanks again for your support, it is much appreciated! 🙏
License
MIT © Shahrad Elahi and contributors.
