@dwebid/sign

2.0.0 • Public • Published

@dwebid/sign

Methods used for creating digital signatures within a mutable user record on a USwarm-based DHT.

Install

npm install @dwebid/sign

API

const { keypair, sign, signable } = dwebsign()

Call the exported function to get a dwebsign instance.

keypair()

Use this method to generate an assymetric keypair. Returns an object with { publicKey, secretKey }, both of which hold Buffers.

sign(username, options)

Create a signature for the user record

Options:

  • keypair - REQUIRED, use keypair to generate
  • dk - REQUIRED, the key to the identity document
  • seq - OPTIONAL, default 0. The sequence number of the value

signable(username, options)

Returns a concatenated Buffer of the username, dk and seq that is used by the sign() method.

Dependents (2)

Package Sidebar

Install

npm i @dwebid/sign

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

3.54 kB

Total Files

3

Last publish

Collaborators

  • dwebprotocol