HTML - keygen Tag



The HTML <keygen> tag is used to process Web forms with certificate management systems. The element generates a secure key and submits the public key.


<!DOCTYPE html>

      <title>HTML keygen Tag</title>

         <keygen name = "random_key" challenge = "0987654321">
         <input name = "firstname" value = "first name">


This will produce the following result −

Global Attributes

This tag supports all the global attributes described in HTML Attribute Reference

Specific Attributes

The HTML <keygen> tag also supports the following additional attributes −

Attribute Value Description
autofocus html-5 autofocus Specifies that when the page loads the <keygen> element automatically gets focus.
challengehtml-5 challenge Specifies the challenge string to be packaged with the public key in the PublicKeyAndChallenge for use in verification of the form submission. If no challenge string is provided, then it is encoded as an IA5STRING of length zero.
disabled html-5 disabled Specifies that <keygen> element should be disabled.
form html-5 form_id Specifies one or more forms.
keytype html-5 rsa
Specifies the secret algorithm which is for the key.
name html-5 autofocus Specifies a name.

Event Attributes

This tag supports all the event attributes described in − HTML Events Reference

Browser Support

Chrome Firefox IE Opera Safari Android
Yes Yes No Yes Yes Yes