HTML - <keygen>

Example

Description  

Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

The HTML <keygen> element exists to facilitate generation of key material, and submission of the public key as part of an HTML form. This mechanism is designed for use with Web-based certificate management systems. It is expected that the <keygen> element will be used in an HTML form along with other information needed to construct a certificate request, and that the result of the process will be a signed certificate.

There is currently discussion among Web browser makers whether to keep this feature or not. Until a decision is reached, it is better to continue to consider this feature as deprecated and going away.

Content categories Flow content, phrasing content, interactive content, listed, labelable, submittable, resettable  form-associated element, palpable content.
Permitted content None, it is an empty element.
Tag omission Must have a start tag and must not have an end tag.
Permitted parent elements Any element that accepts phrasing content.
DOM interface HTMLKeygenElement

Attributes

Includes the Global Attributes.

NameVersionDescription
autofocus This Boolean attribute lets you specify that the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form element in a document can have the autofocus attribute, which is a Boolean.
challenge A challenge string that is submitted along with the public key. Defaults to an empty string if not specified.
disabled This Boolean attribute indicates that the form control is not available for interaction.
form The form element that this element is associated with (its form owner). The value of the attribute must be an id of a <form> element in the same document. If this attribute is not specified, this element must be a descendant of a <form> element. This attribute enables you to place <keygen> elements anywhere within a document, not just as descendants of their form elements.
keytype The type of key generated. The default value is RSA.
name The name of the control, which is submitted with the form data.

Browser Compatibility  

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 [1] 1.0 (1.7 or earlier) No support 3.0 1.2
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 2.3 (Yes) [1] 1.0 (1.0) No support ? No support (Yes) [1]

[1] Deprecated in Chrome 49.

Specifications  

Specification Status Comment
WHATWG HTML Living Standard
The definition of '<keygen>' in that specification.
Living Standard  
HTML5
The definition of '<keygen>' in that specification.
Recommendation  

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/html/element/keygen