Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

keygen

Summary

Represents a key pair generator control

Overview Table

DOM Interface
HTMLKeygenElement

When the control’s form is submitted, the private key is stored in the local keystore, and the public key is packaged and sent to the server.

HTML Attributes

  • autofocus = boolean
    Allows the author to indicate that a control is to be focused as soon as the page is loaded
  • challenge = string
    A challenge string that is submitted along with the public key. [Example A]
  • disabled = boolean
    If present, make the control non-interactive and to prevent its value from being submitted.
  • form = the ID of a form element in the element’s owner
    Associate the keygen element with its form owner.
    By default, the keygen element is associated with its nearest ancestor form element.
  • keytype = rsa
    The type of key generated.
  • name = unique name
    Represents the element’s name.

Examples


<keygen name="key" challenge="235ldahlae983dadfar"/>

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation