npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

hypercore-sign-lib

1.1.0

@chm-diederichs

npmHomeRepoSnykSocket
Downloads:6
$ npm install hypercore-sign-lib
DailyWeeklyMonthlyYearly

hypercore-sign-lib

Sign hypercore signing requests using public/private key cryptography, and verify the signatures.

The flow is:

  • The signer creates a public/private key pair, and shares the public key
  • The signer signs Hypercores (for example to approve of their content at a certain length), and shares the signed message.
  • Anyone with the public key can verify that the hypercore was indeed approved by the signer.

Install

npm i -g hypercore-sign-lib

API

const encryptedKey = await generate(password)

Generate a keyPair and encrypt it using password. Returns a buffer.

const response = await sign(request, encryptedKey, password, [publicKey])

Sign a request using the key and password combination. If password is not correct, signing will fail.

publicKey is only needed for legacy key support.

const valid = verify(response, signingRequest, publicKey)

Veriy response is a valid signature over signingRequest by publicKey.

License

Apache-2.0