The keytype
property sets or gets the keytype attribute of a keygen field.
Keygen keytype |
Yes | No | Yes | Yes | Yes |
Return the keytype property.
var v = keygenObject.keytype
Set the keytype property.
keygenObject.keytype='rsa|dsa|ec'
Value | Description |
---|---|
rsa | Default. Specifies an RSA security algorithm. |
dsa | Specifies a DSA security algorithm. |
ec | Specifies an EC security algorithm. |
A String type value representing the type of key used.
The following code shows how to get the type of key used.
<!DOCTYPE html>
<html>
<body>
Encryption: <keygen id="myKeygen" name="security" keytype="rsa">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {<!--from ww w . j ava2 s . co m-->
var x = document.getElementById("myKeygen").keytype;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: