Could you generate a public key in HTML?

Technology CommunityCategory: HTML5Could you generate a public key in HTML?
VietMX Staff asked 3 years ago

The <keygen> element generates a public-private key pair and sends the public key to the server with form submission. The element is expected to be deprecated and does not have broad browser support.

If two parties want to communicate securely, they each need to be able to generate a public-private key pair, and then hare the public key with the other party. The <keygen> is intended to facilitate this within the context of an HTML form. In browsers that implement it (not all do), if the element is included with a form, the browser generates a key-pair locally and sends the public key to the server when the form is submitted. The private key is then stored locally and not shared.

It has been announced that the <keygen> element will be deprecated and removed from the HTML5 standard. This means that alternate methods of key generation will be needed. Naturally this simply means using JavaScript.