3 include('library/asn1.php');
5 function modexp_init(&$a) {
11 $r = q("SELECT `pubkey` FROM `user` WHERE `nickname` = '%s' LIMIT 1",
18 $lines = explode("\n",$r[0]['pubkey']);
20 unset($lines[count($lines)]);
21 $x = base64_decode(implode('',$lines));
23 $r = ASN_BASE::parseASNString($x);
25 $m = $r[0]->asnData[1]->asnData[0]->asnData[0]->asnData;
26 $e = $r[0]->asnData[1]->asnData[0]->asnData[1]->asnData;
28 header("Content-type: application/magic-public-key");
29 echo 'RSA' . '.' . $m . '.' . $e ;