<keygen> Element
The purpose of the <keygen> element is to provide a secure way to authenticate users.The <keygen> element is a key-pair generator. When a form is submitted, two keys are generated, one private and one public.
The private key is stored on the client, and the public key is sent to the server. The public key could be used to generate a client certificate to authenticate the user in the future.
Currently, the browser support for this element is not good enough to be a useful security standard.
Syntax:
<form action="demo_form.asp" method="get">
Username: <input type="text" name="user_name" />
Encryption: <keygen name="security" />
<input type="submit" />
</form>
Username: <input type="text" name="user_name" />
Encryption: <keygen name="security" />
<input type="submit" />
</form>
Example:
<!DOCTYPE html>
<html>
<body>
<form action="demo_keygen.asp" method="get">
Username: <input type="text" name="user_name" />
Encryption: <keygen name="security" />
<input type="submit" />
</form>
</body>
</html>
<html>
<body>
<form action="demo_keygen.asp" method="get">
Username: <input type="text" name="user_name" />
Encryption: <keygen name="security" />
<input type="submit" />
</form>
</body>
</html>
No comments:
Post a Comment