@li0ard/sm2
v0.1.0
Published
SM2 curves and DSA in pure TypeScript
Readme
Installation
# from NPM
npm i @li0ard/sm2
# from JSR
bunx jsr i @li0ard/sm2Supported modes:
- [x] DSA
- [x] Key exchange
- [x] Encryption schema
Features
- Provides simple and modern API
- Most of the APIs are strictly typed
- Fully complies with GB/T 32918-2016 standard
- Supports Bun, Node.js, Deno, Browsers
Examples
Create signature
import { sign } from "@li0ard/sm2";
const privateKey = hexToBytes("39...B8");
const message = hexToBytes("6D65737361676520646967657374");
console.log(sign(privateKey, message));