Home » HTML » HTML Keygen Tag

HTML Keygen

HTML Keygen Tag

The <keygen> tag specifies a key-pair generator field used for forms. When the form is submitted, the private key is stored locally, and the public key is sent to the server.

<!DOCTYPE html>
<html lang="en">
<title> HTML Keygen Tag </title>
<meta charset="UTF-8">
<form action="action-page.php" method="get">
Username: <input type="text" name="usr_name">
Encryption: <keygen name="security">
<input type="submit">


HTML Keygen Tag
Username: Encryption:

Note: This tag is not used often and is about to get removed from HTML 5.

HTML Keygen Attributes

Attributes Description
autofocus Specifies that a <keygen> element should automatically get focus when the page loads.
challenge Specifies that the value of the <keygen> element should be challenged when submitted.
form Specifies one or more forms the <keygen> element belongs to.
disabled Specifies that a <keygen> element should be disabled.
keytype Specifies the security algorithm of the key.
name Defines a name for the <keygen> element.

Browser Support

Microsoft Edge browser.png Edge
Chrome browser.png Chrome
Firefox browser.png Firefox
Opera browser.png Opera
safari browser.png Safari

Follow Us: