Easy Tutorial
❮ Att Global Spellcheck Att Thead Charoff ❯

HTML <keygen> Tag

Example

A form with a keygen field:


Browser Support

Firefox, Opera, Chrome, and Safari 6 support the <keygen> tag.


Tag Definition and Usage

The <keygen> tag specifies a key-pair generator field for forms.

When the form is submitted, the private key is stored locally, and the public key is sent to the server.


Differences Between HTML 4.01 and HTML5

The <keygen> element is a new tag in HTML5.


Attributes

Attribute Value Description
autofocus New autofocus Allows the <keygen> field to get focus when the page loads.
challenge New challenge If used, the keygen value is set to challenge when submitted.
disabled New disabled Disables the <keygen> element field.
form New form_id Defines one or more forms the <keygen> field belongs to.
keytype New rsa <br>dsa <br>ec Defines the security algorithm of the key.
name New name Defines a unique name for the <keygen> element. The name attribute is used to collect the field's value when the form is submitted.

Global Attributes

The <keygen> tag supports global attributes. See the complete list of HTML Global Attributes.


Event Attributes

The <keygen> tag supports all HTML Event Attributes.

❮ Att Global Spellcheck Att Thead Charoff ❯