HTML | keygen Tag

The <keygen> tag in HTML is used to specify a key-pair generator field in a form. The purpose of <keygen> element is to provide a secure way to authenticate users. When a from is submitted then two keys are generated, private key and public key. The private key stored locally, and the public key is sent to the server. The public key is used to generate client certificate to authenticate user for future.

Syntax:

<keygen name = "name">

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML keygen tag
        </title>
    </head>
      
    <body>
        <h1 style = "color:green;">
            GeeksforGeeks
        </h1
          
        <h2>Keygen Tag</h2
          
        <form>
            Username: <input type="text" name="uname">
            <br><br>
            Encryption: <keygen name="secure">
            <input type="submit">
        </form>
    </body>
</html>                    

chevron_right


Output:
key1

Supported Browsers: The browser supported by <keygen> tag are listed below:

  • Google Chrome
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.