kee-pair
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

kee-pair

CI NPM Version MIT License Install Size

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.

Package Sidebar

Install

npm i kee-pair

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

21.9 kB

Total Files

6

Last publish

Collaborators

  • shahradelahi