5

I need to find some criptographic solution, which allows me to sign some data using private key, and check signature using public key. Would be great if there is some nodejs package.

Thanks!

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
Anatoliy
  • 29,485
  • 5
  • 46
  • 45

2 Answers2

8

Sounds like your needs should be met by the built-in crypto package, no? Check the docs on the createSign and createVerify methods, and the signer and verifier objects they respectively generate. Note that these require your system to have openssl installed where Node can find it.

Trevor Burnham
  • 76,828
  • 33
  • 160
  • 196
  • Thanks for answer, yes, crupto module is what I need. It seems that `crypto` haven't built-in way to generate public-private key for signing/veriying, and I should use `openssl` command, right? – Anatoliy Mar 15 '11 at 16:25
  • Yes, there don't appear to be any cryptographic randomness functions built into Node.js. Though it looks like there's a nice wrapper library around `openssl` for this: https://github.com/akdubya/rbytes – Trevor Burnham Mar 15 '11 at 16:59
1

If you want to sign xml there is xml-crypto - an xml digital signature library for node.js

Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158