2 require_once "lib/ssl.php";
5 if (get_magic_quotes_gpc()) return stripslashes($x);
9 $keysize = mq($_REQUEST['keysize']);
10 $passphrase = mq($_REQUEST['passphrase']);
15 <title
>Public Key Forge
</title
>
19 if ($keysize && is_numeric($keysize)) {
22 $privkey = $ssl->make_privkey($keysize, $passphrase);
23 $pubkey = $ssl->privkey_to_pubkey($privkey, $passphrase);
24 $id = $ssl->pubkey_id($pubkey);
27 echo "<pre>\n$pubkey</pre>\n";
28 echo "<pre>\n$privkey</pre>\n";
31 if (!$keysize ||
!is_numeric($keysize)) $keysize = 512;
34 return htmlspecialchars($x);
42 <td
><input type
="text" name
="keysize" value
="<?php echo hsc($keysize); ?>"/></td
>
45 <td
><input type
="password" name
="passphrase" value
=""/></td
>
48 <td
><input type
="submit" value
="Generate"/></td
>