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> <html> <head> <title>HTML keygen Tag</title> </head> <body> <form> <keygen name = "random_key" challenge = "0987654321"> <input name = "firstname" value = "first name"> </form> </body> </html>
This will produce the following result −
This tag supports all the global attributes described in HTML Attribute Reference
The HTML <keygen> tag also supports the following additional attributes −
Attribute | Value | Description |
---|---|---|
autofocus ![]() |
autofocus | Specifies that when the page loads the <keygen> element automatically gets focus. |
challenge![]() |
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 ![]() |
disabled | Specifies that <keygen> element should be disabled. |
form ![]() |
form_id | Specifies one or more forms. |
keytype ![]() |
rsa dsaec |
Specifies the secret algorithm which is for the key. |
name ![]() |
autofocus | Specifies a name. |
This tag supports all the event attributes described in − HTML Events Reference
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | No | Yes | Yes | Yes |