HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <keygen> Tag


Example

A form with a keygen field:

<form action="demo_keygen.asp" method="get">
  Username: <input type="text" name="usr_name">
  Encryption: <keygen name="security">
  <input type="submit">
</form>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <keygen> tag is supported in Firefox, Opera, Chrome, and Safari 6.


Definition and Usage

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.


Differences Between HTML 4.01 and HTML5

The <keygen> element is new in HTML5.


Attributes

New : New in HTML5.

Attribute Value Description
autofocusNew autofocus Specifies that a <keygen> element should automatically get focus when the page loads
challengeNew challenge Specifies that the value of the <keygen> element should be challenged when submitted
disabledNew disabled Specifies that a <keygen> element should be disabled
formNew form_id Specifies one or more forms the <keygen> element belongs to
keytypeNew rsa
dsa
ec
Specifies the security algorithm of the key
nameNew name Defines a name for the <keygen> element

Global Attributes

The <keygen> tag also supports the Global Attributes in HTML.


Event Attributes

The <keygen> tag also supports the Event Attributes in HTML.



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE