Web development and examples of PHP, jQuery, HTML5, WordPress, MySQL & AMP

HTML5 keygen tag: A new field for key generation

With HTML5 keygen tag we continue to discover the new HTML5 fields.

This tag is used to send keys in web authentication. When the form is submitted, two keys are created, one public key that is sent to the server and will later be used to continue authentication in the system, and another private key that is stored locally in the browser.

Deprecated tag

This is deprecated since 2018.

Syntax of HTML5 keygen tag

The syntax is very simple, here I put its code:

As you can see, it is a tag that is assigned a name.

Keygen’s important attributes

  • keytype: Type of key sent, by default is RSA. Other key types are: EC and DSA.
  • challenge: Specifies if the key changes after sending the form.
  • form: Id of the form the key belongs to.

More info about the HTML5 keygen in this link.

Example of HTML5 keygen tag

In the following example of HTML5 keygen we will see the value of the sent public key. Once you press the send button, you will see how a box calculates the key:

I put the PHP code to obtain the public key sent by POST.

Cookie Policy

This website uses cookies to provide you with the best user experience. If you continue to browsing you are consenting to the acceptance of these cookies and acceptance of our cookie policy, click the link for more information.

Aviso de cookies