New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add signed node support #7

Merged
merged 1 commit into from Aug 1, 2015

Conversation

Projects
None yet
1 participant
@mafintosh
Owner

mafintosh commented Jul 30, 2015

adds support for signing/verifying graph nodes using the following api

var log = hyperlog(db, {
  publicKey: myPublicKeyBuffer,
  sign: function (node, cb) {
    myCrypto.sign(node.key, mySecretKey, function (err, signature) {
      cb(err, signature)
    })
  },
  verify: function (node, cb) {
    if (!node.signature || !node.publicKey) return cb(null, false) // only allow signed nodes
    myCrypto.verify(node.key, node.signature, node.publicKey, function (err, valid) {
      cb(err, valid)
    })
  }
})
@mafintosh

This comment has been minimized.

Show comment
Hide comment
@mafintosh

mafintosh Jul 30, 2015

Owner

Maybe .publicKey should be renamed to .identity? That probably indicates better that this could also be a hash of a public key fx. @substack thoughts?

Owner

mafintosh commented Jul 30, 2015

Maybe .publicKey should be renamed to .identity? That probably indicates better that this could also be a hash of a public key fx. @substack thoughts?

@mafintosh

This comment has been minimized.

Show comment
Hide comment
@mafintosh

mafintosh Aug 1, 2015

Owner

publicKey is now identity

Owner

mafintosh commented Aug 1, 2015

publicKey is now identity

mafintosh added a commit that referenced this pull request Aug 1, 2015

@mafintosh mafintosh merged commit 4705046 into master Aug 1, 2015

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@mafintosh mafintosh deleted the signed-log branch Aug 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment