How to use Javascript to create a digital signature
This article introduces the knowledge of "how to use Javascript to create a digital signature". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Sometimes it is necessary for the user to sign the text to prove that he is the one who completed the operation. For example, in e-banking software, users may have to sign a text describing the transaction ("transfer $300 to IBAN xxxxxxxxx") or sign a government e-service request. This can be done through java-applet, but since JRE owners are not in the majority, it is best to use other methods.
Of course, the premise is that the user has a digital signature signed by CA and installs the certificate in the browser according to CA's manual. If these steps are not completed successfully, the following solution will not work.
Also note that this uses PKCS7 (Java developers: use inflatable castles to validate it) instead of the XAdES standard. Internet Explorer supports XAdES, but FireFox does not.
Let's look at a simple HTML page that should sign a given text: