<keygen> tag

HTML5 <keygen> tag

This <keygen> tag generates  a key pair i.e. a private encrypted key and a public key.

The private key is stored in the local keystore while the public key is sent in encrypted form to the server along with the form submission.

It helps in authenticating the Transport layer Security(TLS) services to create signed certificates.

As browser support for this tag is limited, so this element is deprecated in HTML5.

It is removed from web standards and it is in process of being dropped in future.

<keygen name=”name”>


<form action="#"> 
	Email: <input type="email" name="email"> 
	Encrypt: <keygen name="rsakey" keytype="RSA" challenge="9879322"> 
	<input type="submit" value="submit"> 

Default CSS Value


How Browser will display


Difference between HTML4.01, XHTML and HTML5

NA NA Initially, this tag was introduced in HTML5 and later deprecated in HTML5

Attributes used with <keygen> tag

Attribute Description
autofocus To focus the element automatically when the browser loads the form.To define this, simply code "autofocus" along with the <keygen> tag.
challenge Packages the challenge string with the public key PublicKeyAndChallenge for verifying forms. If you do not code this, the browser will take a value of IA5STRING with length as 0
disabled It disables the <keygen> field so that the user cannot edit it. The value is disabled.
form The form attribute defines one or more forms for the elements belong to using a form_id.
keytype Defines the type of key. Each type follows its own algorithm. It can take values such as RSA, DSA etc. RSA is the default keytype
name Describes the name of the control.

Global Attributes

The <keygen> tag supports Global attributes.

Event Attributes

The <keygen> tag supports Event attributes.

Supporting Browsers

supporting-browsers for tags

Related Tags

<form>, <label> and <input> tags.

Tutorials for all brains!