简体   繁体   English

如何在node.js中实现数字签名

[英]How to implement Digital Signatures in node.js

I'm new in node.js and I need to implement digital signatures.The Scenario is that, a user "A" will send some data by signing it with its private key (Stored on local machine) on to the server. 我是node.js的新手,我需要实现数字签名。这种情况是,用户“ A”将通过使用其私钥(存储在本地计算机上)签名到服务器上来发送一些数据。 So any other user "B" can verify it by decrypting the data with public key (Stored in DB on server) of "A". 因此,任何其他用户“ B”都可以通过使用“ A”的公共密钥(存储在服务器上的DB中)解密数据来验证它。 Now following are my questions. 现在是我的问题。 How to generate public private keys? 如何生成公共私钥? How to store private key on local machine? 如何在本地计算机上存储私钥? How to sign data using private key and how to verify it using public key? 如何使用私钥签名数据以及如何使用公钥验证数据?

I found the below flow diagram on google. 我在Google上找到了以下流程图。 You can use this to get a grasp of he functionality. 您可以使用它来掌握功能。 You can use this library to implement your signatures. 您可以使用此库来实现您的签名。 Not sure if this solves your problem or not, but I hope it will help you in getting some clarity. 不知道这是否可以解决您的问题,但希望它能帮助您弄清楚。

图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM