eckey-util
v1.0.4
Published
Eckey privateKey, publicKey and sign verify
Downloads
11
Maintainers
Readme
ECKey utils
Elliptic curve signature, public and private key generation and public key verification are realized. Signature algorithm ECDSA
npm i eckey-util --save
Create private key
const ECKey = require('eckey-util')
ECKey.createPrivate()
Get public key
ECKey.getPublicKey(privateKey)
Sign
let signed = ECKey.sign('Hello world!', privateKey)
SignHash
let signed = ECKey.signHash(ECKey.createHash('Hello world!'), privateKey)
Verify
ECKey.verify('Hello world!', signed, publicKey)
VerifyHash
ECKey.verifyHash(ECKey.createHash('Hello world!'), Buffer.from(signed, 'hex'), publicKey)