Web4College

HTML keygen tag

keygen stands for key generator.<keygen> element generates public-private key pair. The public key is sent to the server after submitting the form. This element is the child of form element.

Preview Example
Try it
Warning! <keygen> is now obsolete.

Specific uses

It is used to protect password in a login system.

Related tags

TagsDescription
<form>It breaks a line into multiple lines.
Example
Try it
<form> form data </form>
<input>It breaks a line into multiple lines.
Example
Try it
<form> <input>input data</input> </form>

Tag omission

There is no end tag of <keygen> element.

Global Attributes

All global attributes are applicable on <keygen> element.

Specific Attributes

<keygen> tag attributes

AttributesDescription
autofocusfocuses the cursor element to the keygen input control.
Example
Try it
<keygen name="keysecurity" autofocus>
challengea type of string to submit with public key.
disableddisables the keygen element. It is not focusable.
Example
Try it
<keygen name="keysecurity" disabled>
formIt associates keygen element with a form.
Example
Try it
<keygen name="keysecurity" form="id of the form">
keytypeSome kind of key with RSA algorithm.
Example
Try it
<keygen name="keysecurity" keytype="rsa">
nameSpecifies a unique name for processing
Example
Try it
<keygen name="keysecurity" >