HTML5 Guidelines for Web Developers

(coco) #1
3.3 New Elements 53

The onchange event within the select element inserts the current text of the se-
lection menu into the text box (see Figure 3.8).


Figure 3.8 A combination of “input” and “select” elements as fallback for older browsers (here,
Internet Explorer 8)


3.3.4 Cryptographic Keys with “keygen”


The keygen element has a long history in the Mozilla Firefox browser (included
since version 1.0), but Microsoft still expressed great concern regarding the im-
plementation in HTML5. keygen is used to generate cryptographic keys, which
sounds complicated, and unfortunately, it is just as complicated as it sounds.


Simply put, the idea behind this element is this: The browser creates a pair of
keys, one a public key and the other a private key. The public key is sent off with
the other form data and is then available to the server application, whereas the
private key remains saved in the browser. After this exchange of keys, the serv-
er and browser can communicate in encryption without SSL certificates. This
sounds like a practical solution for those pesky self-signed certificates, which
browsers keep complaining about, but sadly it is not, because the identity of the
server can only be verified through a certificate that has been signed by a trust-
worthy authority, the Certificate Authority (CA).


So if keygen cannot replace SSL, what should the new element be used for? As ex-
plained in the Mozilla documentation, the keygen element helps create a certifi-
cate that the server can sign (signed certificate). To make this step totally secure,
it is usually necessary for the applicant to appear personally before the authority.
Because the issuing of signed certificates is a task for experts, we will briefly de-
scribe this element and its attributes.

Free download pdf