English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de Referência HTML

大全 de Tags HTML

HTML5: Tag <keygen>

O elemento <keygen> do HTML é para facilitar a geração de materiais de chave e submissão da chave pública como parte de um formulário HTML. Este mecanismo é usado para projetar sistemas de gerenciamento de certificados baseados na Web. Segundo o esperado, o elemento <keygen> será usado para construir uma solicitação de certificado junto com informações necessárias em formulários HTML, e o resultado desse processo será um certificado com assinatura.

Esta tag foi descontinuada no novo padrão da Web.

Exemplo Online

Formulário com campo keygen:

!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Manual Básico(oldtoolbag.com)</title> 
</head>
<body>
<form action="demo-form.php" method="get">
  Nome de usuário: <input type="text" name="usr_name">
  Criptografia: <keygen name="name" challenge="challenge string" keytype="type" keyparams="pqg-params">
  <input type="submit">
</form>
<p><strong>Atenção:/strong> O Internet Explorer não suporta a tag keygen.</p>
</body>
</html>
Teste e veja ‹/›

Compatibilidade do navegador

IEFirefoxOperaChromeSafari

Firefox, Opera, Chrome e Safari 6 Todos suportam a tag <keygen>.

Definição e instruções de uso da tag

A tag <keygen> define um campo gerador de pares de chaves para o formulário.

Quando o formulário é submetido, a chave privada é armazenada localmente e a chave pública é enviada para o servidor.

Esta característica foi removida dos padrões da Web, embora alguns navegadores ainda a suportem atualmente, pode ser que parem de suportá-la em algum momento futuro. Evite usar essa característica.

HTML 4.01 with HTML5between the differences

<keygen> element is HTML5 New tag.

Attribute

New: HTML5 New attribute.

AttributeValueDescription
autofocusHTML5autofocusMake the <keygen> field get focus when the page loads.
challengeNewchallengeIf used, set the keygen value to ask for it at submission.
disabledHTML5disabledDisable the <keygen> element field.
formHTML5form_idDefine one or more forms that the <keygen> field belongs to.
keytypeHTML5rsa
dsa
ec
Define the secure key algorithm.
nameHTML5nameDefine the unique name of the <keygen> element. The name attribute is used to collect the value of the field when submitting the form.

Global attributes

<keygen> tag supports global attributes, see the complete attribute table HTML global attributes.

event attributes

<keygen> tag supports all HTML event attributes.