English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The HTML <keygen> element is designed to facilitate the generation of key material and the submission of the public key as part of an HTML form. This mechanism is used to design Web-based certificate management systems. As envisioned, the <keygen> element will be used to construct a certificate request along with other required information in an HTML form, resulting in a signed certificate.
This tag has been deprecated in the new Web standard.
Form with keygen field:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Tutorial(oldtoolbag.com)</title> </head> <body> <form action="demo-form.php" method="get"> Username: <input type="text" name="usr_name"> Encryption: <keygen name="name" challenge="challenge string" keytype="type" keyparams="pqg-params"> <input type="submit"> </form> <p><strong>Attention:/strong>Internet Explorer does not support the keygen tag.</p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Firefox, Opera, Chrome, and Safari 6 All support the <keygen> tag.
The <keygen> tag specifies a key pair generator field for the form.
When submitting a form, the private key is stored locally, and the public key is sent to the server.
This feature has been removed from the Web standard, although some browsers still support it at present, it may stop supporting it at some point in the future. Please try not to use this feature.
<keygen> element is an HTML5 New Tag.
New: HTML5 New Attribute
Attribute | Value | Description |
---|---|---|
autofocusHTML5 | autofocus | Make the <keygen> field focused when the page loads. |
challengeNew | challenge | If used, set the keygen value to prompt for at submission. |
disabledHTML5 | disabled | Disable the <keygen> element field. |
formHTML5 | form_id | Define one or more forms that the <keygen> field belongs to. |
keytypeHTML5 | rsa dsa ec | Define the secure algorithm for key generation. |
nameHTML5 | name | Define a unique name for the <keygen> element. The 'name' attribute is used to collect the value of a field when submitting a form. |
<keygen> tag supports global attributes, see the complete attribute table HTML Global Attributes.
<keygen> tag supports all HTML Event Attributes.