Open In App

HTML <keygen> keytype Attribute

The HTML <keygen> keytype attribute is used to define the type of key which would be used. Basically, this attribute is used to secure the form data. 

Note: The keytype may be different in different browsers.



Syntax:

<keygen keytype="rsa|dsa|ec">

Attribute values:



 

Example: Below code illustrates the keytype attribute of the <keygen> element.




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML keygen keytype attribute
    </title>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
  
        <h2>HTML Keygen keytype attribute</h2>
  
        <form>
            Username: <input type="text" name="uname">
            <br><br>
            Encryption: <keygen form="myGeeks" 
                keytype="rsa" name="secure" disabled>
                  
            <input type="submit">
        </form>
      </center>
</body>
  
</html>

Output:              

Supported Browsers:


Article Tags :