HTML keygen tag

HTML keygen tag is used to generate key pairs public and private keys.

The keygen tag used for the encryption to pass the encrypted data to the server.

The keygen tag is used inside HTML form tag. When the form get sumitted, the browser will generate the key pairs. The browser then store the private key in the browser key storage then after it send the public key to the server.


This is the example for html keygen tag using inside form tag to generate two key ke pairs.


List of HTML keygen tag attributes

Sr. No. Atribute options Description
1 name This attribute contains the name of the keygen element used for form submission.
2 form This specified the id of the form to use for the key generation. The value for this is the id of the form
3 keytype This specified the type of the algorithm for key generation. The values for this attribute are rsadsa and ec
4 disabled This attribute can be used to disable the keygen element. This contains boolean value disabled
5 challenged This attribute can be used to specify the keygen element should be challenged when submitted.
6 autofocus This attribute can be used to aumattically focus the keygen element on page load.

Resources and References

1. W3C Specification.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Get FREE Access to Toolkit and Resources that we are using in Tutorialdeep that Every Professional Should Have! in one handy PDF.

Download Link Will be Send to Your Email id